<?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=Flherne</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=Flherne"/>
	<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/wiki/Special:Contributions/Flherne"/>
	<updated>2026-06-03T15:18:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action6&amp;diff=4807</id>
		<title>Action6</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action6&amp;diff=4807"/>
		<updated>2024-07-25T14:07:51Z</updated>

		<summary type="html">&lt;p&gt;Flherne: Put the behaviour for versions people care about first.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Action 6 allows modifying the contents of the following sprite. It uses the values of the grf parameters and writes them into the data of the following sprite.&lt;br /&gt;
&lt;br /&gt;
Since TTDPatch 2.0.1 alpha 51, Action 6 is applied both at initialization as well as activation, and can be skipped with either Action 7 or 9 as appropriate.&lt;br /&gt;
&lt;br /&gt;
Previously this action was processed only once during the initialization of a .grf file and ignored during the following activations when starting or loading a game. You must use Action 9 and not Action 7 to skip Action 6 if compatibility with such ancient versions is required.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 06 (&amp;lt;param-num&amp;gt; &amp;lt;param-size&amp;gt; &amp;lt;offset&amp;gt;){n} FF&lt;br /&gt;
&lt;br /&gt;
{| |-&lt;br /&gt;
!&#039;&#039;&#039;Element&#039;&#039;&#039;!![[GRFActionsDetailed|&#039;&#039;&#039;Size&#039;&#039;&#039;]]!!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sprite-number&amp;gt;||dec||A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;||dec||The total number of bytes used in this action&lt;br /&gt;
|-&lt;br /&gt;
|06||B||Defines action 06&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;param-num&amp;gt;||B||Which grf parameter to apply&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;param-size&amp;gt;||B||How many bytes to overwrite&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;offset&amp;gt;||B*||Which byte to overwrite&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;FF&amp;gt;||B||Marks the end of the list&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The triplet of &amp;lt;param-num&amp;gt; &amp;lt;param-size&amp;gt; &amp;lt;offset&amp;gt; can be repeated as often as desired.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== param-num ===&lt;br /&gt;
&lt;br /&gt;
This is the parameter number from the newgrf(w).cfg parameters to apply to the following sprite data. It can of course be the result of an ActionD calculation as well. The first parameter has number 00.&lt;br /&gt;
&lt;br /&gt;
The modification is not carried out if the parameter has not been defined yet.&lt;br /&gt;
&lt;br /&gt;
=== param-size ===&lt;br /&gt;
&lt;br /&gt;
How many bytes of the parameter to use. If this is larger than 4 (the size of a parameter), the bytes of the following parameter are used. In that case, all required parameters must be defined or no modification will be done.&lt;br /&gt;
&lt;br /&gt;
If this value has bit 7 set, the parameter is &#039;&#039;added&#039;&#039; to the destination value, instead of simply stored. This is useful especially when allocating sprites using the GRF Resource Management, because one typically allocates more than one sprite, but the parameter can only hold a single number, the first sprite allocated. &amp;lt;br&amp;gt;Thus, to apply several sprite numbers properly (such that it works for several activations, not just the first one), use an algorithm like the following:&lt;br /&gt;
* Suppose you have a sprite number &amp;lt;nowiki&amp;gt;&amp;lt;s&amp;gt;&amp;lt;/nowiki&amp;gt; to which you want to add &amp;lt;nowiki&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/nowiki&amp;gt; (where &amp;lt;nowiki&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/nowiki&amp;gt; is returned by the GRF Resource Management)&lt;br /&gt;
* To make this work several times (whenever the grf is activated), you cannot simply add &amp;lt;nowiki&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/nowiki&amp;gt; to &amp;lt;nowiki&amp;gt;&amp;lt;s&amp;gt;&amp;lt;/nowiki&amp;gt; directly&lt;br /&gt;
* Instead, use [[ActionD]] to define a new, otherwise unused parameter &amp;lt;j&amp;gt;, and store in it the value of &amp;lt;nowiki&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/nowiki&amp;gt; before it is set by Action D, i.e. &amp;lt;j&amp;gt; holds the previous value of &amp;lt;nowiki&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
* Next, after setting &amp;lt;nowiki&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/nowiki&amp;gt; with the GRF Resource Management, calculate &amp;lt;j&amp;gt; = &amp;lt;nowiki&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/nowiki&amp;gt; - &amp;lt;j&amp;gt; (i.e. subtract the previous value of i from the new value of i and store in j).&lt;br /&gt;
* Use Action 6 to add the value of &amp;lt;j&amp;gt; to &amp;lt;nowiki&amp;gt;&amp;lt;s&amp;gt;&amp;lt;/nowiki&amp;gt;, instead of adding the value of &amp;lt;nowiki&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/nowiki&amp;gt; directly.&lt;br /&gt;
* This way, the new value &amp;lt;nowiki&amp;gt;&amp;lt;s&amp;gt;&amp;lt;/nowiki&amp;gt; is the current value of &amp;lt;nowiki&amp;gt;&amp;lt;s&amp;gt;&amp;lt;/nowiki&amp;gt; plus the new &amp;lt;nowiki&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/nowiki&amp;gt; minus the old &amp;lt;nowiki&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/nowiki&amp;gt;, which is the initial value of &amp;lt;nowiki&amp;gt;&amp;lt;s&amp;gt;&amp;lt;/nowiki&amp;gt; plus the new &amp;lt;nowiki&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/nowiki&amp;gt;, just what we wanted.&lt;br /&gt;
* Skip the action D&#039;s as well as both action 6 and the action it modifies during the [[GrfLoadingStages|&amp;quot;test&amp;quot; stage]] by skipping these actions if action 7 var 84 has bit 10 set.&lt;br /&gt;
* Make sure that when using action 7/9, that either &#039;&#039;both&#039;&#039; or &#039;&#039;none&#039;&#039; of the above two operations are skipped. if only one but not the other is skipped, the values will go out of synch.&lt;br /&gt;
&lt;br /&gt;
See below for an example.&lt;br /&gt;
&lt;br /&gt;
=== offset ===&lt;br /&gt;
&lt;br /&gt;
Number of byte in the following sprite to modify. The counting starts with 0 at the action byte and can go up to the length of the sprite. It is not possible to add data at the end of the sprite.&lt;br /&gt;
&lt;br /&gt;
Since {{ottdp| |2.5|ttdprev=alpha 51}}, this is an extended byte (see [[GRFActionsDetailed]]).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
This is an example on how to apply the sprite numbers returned by the GRF Resource Management to an action 0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;// First, set param 1 (&amp;lt;j&amp;gt;) to the old value of param 0 (&amp;lt;i&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; -1 * 5 &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;0D 01 00 00 00&lt;br /&gt;
&lt;br /&gt;
// Then, use the GRF Resource Management to reserve 3 sprites&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; -1 * 9 &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;0D 00 00 00 FE FF 08 03 00&lt;br /&gt;
&lt;br /&gt;
// Now calculate &amp;lt;j&amp;gt; = &amp;lt;i&amp;gt; - &amp;lt;j&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; -1 * 5 &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;0D 01 02 00 01&lt;br /&gt;
&lt;br /&gt;
// So &amp;lt;j&amp;gt; = new &amp;lt;i&amp;gt; - old &amp;lt;i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Use Action 6 to add &amp;lt;j&amp;gt; to the sprite numbers in the sample sprite layout&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; -1 * 11 &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; 06 01 84 07 01 84 11 01 84 1B FF&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; -1 * 32 &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; 00 04 01 01 00 09&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;01&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;00 00 00 00 &amp;amp;nbsp; &amp;amp;nbsp; // first allocated sprite&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;00 00 00 &amp;amp;nbsp;10 05 02 &amp;amp;nbsp;01 00 00 00 // second allocated sprite&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;00 0B 00 &amp;amp;nbsp;10 05 02 &amp;amp;nbsp;02 00 00 00 // third&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;80&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4471</id>
		<title>Action5</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4471"/>
		<updated>2023-06-27T22:06:21Z</updated>

		<summary type="html">&lt;p&gt;Flherne: 09 arrows clarification.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define base graphics specific sets&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Action 5 is used to define graphics for several new features of OpenTTD and TTDPatch. This is similar to action 1.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 05 &amp;lt;type&amp;gt; &amp;lt;num-sprites&amp;gt; [&amp;lt;offset&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Sprite-number&amp;gt;||dec||A sequential sprite number&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;||dec||The total number of bytes used in this action&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05||B||Defines action 05&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;type&amp;gt;||B||What type of graphics follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;num-sprites&amp;gt;||B*||How many regular sprites follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;offset&amp;gt;||B*||Offset in the Action 5 assignable block of sprites&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following num-sprites sprites in the .nfo file have to be RealSprites that will be used as graphics for the given TTDPatch feature, except for type 0A, which requires RecolorSprites.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|2.5|ttdprev=alpha 19}}Action 5 entries in a .grf file which has a regular GRFID (not FFFFFFFF) will always override those from .grf files with a GRFID of FFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== type ===&lt;br /&gt;
&lt;br /&gt;
This sets the type of feature that the graphics are for. If bit 7 is set, the offset variable needs to be set. Bit 7 may only be set if the type supports it. The type can be one of:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Type!!Version!!Feature!!num-sprites (decimal)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal and semaphore graphics||112&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04,84&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Offset allowed since {{ottdp|1.2|no|ottdrev=r23005}}&amp;lt;/ref&amp;gt;||{{ottdp| |2.5|ttdprev=alpha 41}}||Pre-signal, semaphore, and PBS graphics||240&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05,85&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.0}}||Overhead wires and pylon graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06 ||{{ottdp|0.6| }}||Foundations (retaining walls) for BuildOnSlopes ||74&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06,86&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11321}}||Foundations for BuildOnSlopes and half tiles (NS and EW foundations) ||90&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|07||{{ottdp|no|2.5|ttdprev=alpha 43}}||TTDPatch GUI sprites||93 &amp;lt;ref&amp;gt;Type 07 only requires 73 sprites in the stable (2.5 branch); the extra sprites are the clone train and build canal cursors.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|08,88&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no}}&amp;lt;ref&amp;gt;TTDPatch supported canals via Action5 from 2.0.1 alpha 17 up to alpha 25. In alpha 26 it was removed again in favour of an action-1-2-3 method; see [[Action3/Canals|Action3]]. The method via Action5 is no longer supported by TTDpatch 2.0.1 alpha 26 and newer.&amp;lt;/ref&amp;gt;||Canals||65&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|09,89&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 58}}||One-way road arrows||{{ottdp|13|no}} 18 {{ottdp|0.6 - 12|2.5}} 6&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0A,8A&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 67}}||Two company color translation maps||256&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0B,8B&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 68}}||Tram tracks||{{ottdp|1.10|no}} 119 {{ottdp|0.6 - 1.9|2.5}} 113&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0C||{{ottdp|no|2.5|ttdprev=alpha 74}}||Snowy temperate trees||133&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0D||{{ottdp|0.6|2.5|ottdrev=r7325 (r11726)|ttdprev=beta 5}}||Coast Tile graphics||16 (18)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0E||{{ottdp|no|2.6|ttdprev=r1247}}||New Signals||Any&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0F,8F&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13469|ttdprev=r1487}}||Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP)||Up to 12&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|10,90&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r9645}}||Additional airport graphics||15&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|11,91&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.6|ottdrev=r9645|ttdprev=r1589}}||Road stop graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12,92&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13464|ttdprev=r1498}}||Aqueduct graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|13,93&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11433}}||Autorail sprites||55&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|14,94||{{ottdp|0.6 - 1.11|no|ottdrev=11433}}||Flag sprites (no longer used)||Up to 36&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|15,95||{{ottdp|0.6|no|ottdrev=r11433}}||OpenTTD GUI sprites||Up to 191&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|16,96||{{ottdp|1.1|no|ottdrev=r20370}}||Airport preview sprites||Up to 9&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|17,97||{{ottdp|1.2|no|ottdrev=r23952}}||Railtype tunnel base sprites||16&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|18,98||{{ottdp|1.5|no|ottdrev=r26869}}||Extra all black palette||1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 04 Signal graphics. ====&lt;br /&gt;
&lt;br /&gt;
Signal graphics come in groups of 16. These groups contain sprites in the same order as sprites 1275-1290 in trg1[r].grf; red, then green, for each of: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Group(s)!!Contents&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0||lighted entrance signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|1||lighted exit signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|2||lighted combo signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3||standard (non-pre-signal) semaphore signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4..6||repeat 0..2 for semaphores&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|7||standard lighted PBS signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|8..14||repeat 0..6 for PBS signals&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 09 One-way road arrows ====&lt;br /&gt;
&lt;br /&gt;
Overlay sprites to indicate the direction of one-way roads.&lt;br /&gt;
The 6 sprites originally supported from {{ottdp|0.6|2.5}} are, in order:&lt;br /&gt;
&lt;br /&gt;
 arrow facing SW, arrow NE, impassable NE-SW, arrow NW, arrow SE, impassable NW-SE.&lt;br /&gt;
&lt;br /&gt;
Before {{ottdp|13|no}} these are used on both flat and sloped roads.&lt;br /&gt;
&lt;br /&gt;
From {{ottdp|13|no}} the grf can optionally provide 18 sprites instead of 6.&lt;br /&gt;
In this case the first 6 sprites are used for flat tiles only. The next 6 are used in the same sequence for slopes with the N corner raised, and the last 6 for slopes with the S corner raised.&lt;br /&gt;
&lt;br /&gt;
==== 0C Snowy temperate trees ====&lt;br /&gt;
&lt;br /&gt;
If the temperate snow line is enabled, you can use this to specify the snowy versions of temperate trees. The sprites must be the snowy versions of sprites 1576-1708 from TRG1.GRF, in the same order as they appear there.&lt;br /&gt;
&lt;br /&gt;
==== 0D Coast tile sprites ====&lt;br /&gt;
&lt;br /&gt;
===== In NewGRFs =====&lt;br /&gt;
If diagonal flooding is enabled then due to new corner coasts, you can use this to give a complete set of replacement coast tile sprites. There are 16 in total, 8 original Transport Tycoon Deluxe sprites and 8 for the corner slopes. Order of the sprites&amp;lt;ref name=numbers&amp;gt;Sprite numbers from trg1(r).pcx.&amp;lt;/ref&amp;gt; is as follows:&lt;br /&gt;
&lt;br /&gt;
 3997, 4063, 4064, 4068, 4062, 3998, 4066, 3988,&lt;br /&gt;
 4065, 4069, 3996, 3992, 4067, 3994, 3995, 3999.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast16Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The 16 sprites for feature 0D&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== In Base Set&#039;s extra grf =====&lt;br /&gt;
Additionally, OpenTTD (since r11726) supports another method of supplying all additional coast tile sprites, but this is only allowed in the &#039;&#039;extra&#039;&#039; NewGRF of [http://wiki.openttd.org/Base_graphics Base Graphic Sets]. In this, only 10 sprites are supplied in the same order as the 16 sprites above, but without the coast sprites already in the base grf. Note that the 10 sprites version supplies two additional slopes, but they are not used, and are currently unlikely to be ever used.&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast10Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Only 10 sprites are required for OpenTTD base graphic sets&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In OpenTTD 10 sprites for type 0D is enough in base graphic sets. The 16 sprites version should not be used for base graphics.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason for the existence of a 10 sprite version is to remove the need for including original graphics, and to keep compatibility with old NewGRFs that replace the original shore graphics using Action A without adding new shores using Action 5: When a NewGRF uses the 16 sprites version it takes precedence above any NewGRF replacing the shore graphics using Action A; when a NewGRF uses Action A to replace shore graphics it takes precedence above a 10-sprite Action 5, effectively disabling diagonal flooding. Also due to compatibility the 10 sprites version is invalid for normal NewGRFs, which are not the &amp;quot;extra&amp;quot; NewGRF of some Base Graphics Set.&lt;br /&gt;
&lt;br /&gt;
==== 0E New Signals ====&lt;br /&gt;
&lt;br /&gt;
Any number of real and recolour sprites can be specified in the action in any order.&lt;br /&gt;
&lt;br /&gt;
Sprites are referenced by their offset into the action5 block by a [[VarAction2NewSignals]], hence a logically easily calculable order is advised.&lt;br /&gt;
&lt;br /&gt;
As of TTDPatch 2.6 alpha 0 r1346, the action 5 block defined in the same GRF file as the varaction2, will be used as the base sprite block for the offsets returned by the callback even if it is overridden by a higher priority GRF action 5 definition of the same feature (0E).&lt;br /&gt;
&lt;br /&gt;
==== 0F Tracks for Slopes ====&lt;br /&gt;
&lt;br /&gt;
This should be in the same order as sprites 1031 to 1035 (1). These should only be the rails, basically the same format as sprites 1005 to 1010 (1). There should be 3 groups of these sprites, one for each rail type (railroad, monorail, maglev).&lt;br /&gt;
&lt;br /&gt;
(1) Sprite numbers from trg1r.pcx / ogfx1_base.grf&lt;br /&gt;
&lt;br /&gt;
==== 11 Road stop graphics ====&lt;br /&gt;
&lt;br /&gt;
Road stop graphics consist of 2 groups of 4 sprites. The first group contains graphics for bus stops, second for truck stops. In each group, the sprites are in the following order: SW, NE, NW, SE.&lt;br /&gt;
&lt;br /&gt;
SW and NE sprites are used with road going along the Y axis ( .\&#039; ), NW and SE with road along the X axis( &#039;/. ).&lt;br /&gt;
&lt;br /&gt;
Internally, the stations are defined using the following station layouts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1313&lt;br /&gt;
&lt;br /&gt;
\b13 \b0 \b0 \b3 \b16 \b16 &amp;lt;SW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b3 \b16 \b16 &amp;lt;NE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1314&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b16 \b3 \b16 &amp;lt;NW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b13 \b0 \b16 \b3 \b16 &amp;lt;SE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where 1313 and 1314 are town road sprites.&lt;br /&gt;
&lt;br /&gt;
[[File:roadstops.png]]&lt;br /&gt;
&lt;br /&gt;
Further sprites can be found in &#039;&#039;&#039;openttd.grf&#039;&#039;&#039; (OpenTTD), &#039;&#039;&#039;ogfxe_extra.grf&#039;&#039;&#039; (OpenGFX) or &#039;&#039;&#039;ttdpbase(w).grf&#039;&#039;&#039; (TTDPatch).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As of OpenTTD r10185, the behaviour of this feature is identical in both games.&lt;br /&gt;
&lt;br /&gt;
==== 12 Aqueducts ====&lt;br /&gt;
&lt;br /&gt;
8 real sprites should be given. Firstly: 4 bridge end sprites in the order: SW, SE, NE, NW, where the direction is that heading onto the aqueduct. Then 2 middle part sprites for the X and Y directions. Followed by two pillar sprites for the X and Y directions. For examples of where the division between middle sprites and pillars should be made see sprites 2437 to 2592 (1), or an existing aqueduct GRF. Note, that for higher bridges to work effectively, pillars should be approximately 8px in height.&lt;br /&gt;
&lt;br /&gt;
[[File:aqueduct.png]]&lt;br /&gt;
&lt;br /&gt;
==== 15 / 95 OpenTTD GUI sprites ====&lt;br /&gt;
&lt;br /&gt;
OpenTTD defines 190 GUI sprites. Additional sprites not needed by an OpenTTD are simply ignored, so that new(er) base sets can be used by old OpenTTD versions. One can (re-)define a subset of the GUI sprites by giving an offset into the GUI sprites. The sprites are:&lt;br /&gt;
{|&lt;br /&gt;
!Offset !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0 .. 11|| Halftile selections&lt;br /&gt;
|-&lt;br /&gt;
|12 .. 13 || Title screen letters E and D&lt;br /&gt;
|-&lt;br /&gt;
|14 .. 37 || Bridge piers colours 1 .. 4&lt;br /&gt;
|-&lt;br /&gt;
|38 || square indicating NewGRF compatibility&lt;br /&gt;
|-&lt;br /&gt;
|39 || blob indicating server compatibility&lt;br /&gt;
|-&lt;br /&gt;
|40 || lock icon&lt;br /&gt;
|-&lt;br /&gt;
|41 || empty check box&lt;br /&gt;
|-&lt;br /&gt;
|42 || checked check box&lt;br /&gt;
|-&lt;br /&gt;
|43 || warning sign&lt;br /&gt;
|-&lt;br /&gt;
|44 || window resize right&lt;br /&gt;
|-&lt;br /&gt;
|45 .. 48|| arrows&lt;br /&gt;
|-&lt;br /&gt;
|49 || house&lt;br /&gt;
|-&lt;br /&gt;
|50 || shared orders&lt;br /&gt;
|-&lt;br /&gt;
|51 .. 52 || pin / pinned&lt;br /&gt;
|-&lt;br /&gt;
|53 .. 62 || rail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|63 .. 68 || monorail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|69 .. 74 || maglev build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|75 || ??&lt;br /&gt;
|-&lt;br /&gt;
|76 .. 77 || waypoint toolbar and cursor icon&lt;br /&gt;
|-&lt;br /&gt;
|78 .. 81 || waypoint buildings&lt;br /&gt;
|-&lt;br /&gt;
|82 .. 85 || autoroad toobar and cursor for road and trams&lt;br /&gt;
|-&lt;br /&gt;
|86 || helipad&lt;br /&gt;
|-&lt;br /&gt;
|87 || build ship lift cursor&lt;br /&gt;
|-&lt;br /&gt;
|88 .. 89 || build canal toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|90 || fast forward&lt;br /&gt;
|-&lt;br /&gt;
|91 .. 92 || level land toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|93 .. 96 || sell vehicle&lt;br /&gt;
|-&lt;br /&gt;
|97 .. 100 || sell all vehicles&lt;br /&gt;
|-&lt;br /&gt;
|101 .. 104 || replace vehicle&lt;br /&gt;
|-&lt;br /&gt;
|105 || sell chain of rail vehicles&lt;br /&gt;
|-&lt;br /&gt;
|106 .. 113 || clone vehicles button and cursors&lt;br /&gt;
|-&lt;br /&gt;
|114 .. 117 || create vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|118 .. 121 || delete vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|122 .. 125 || rename vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|126 .. 133 || group replace on / off button&lt;br /&gt;
|-&lt;br /&gt;
|134 || road toolbar: build one-way roads&lt;br /&gt;
|-&lt;br /&gt;
|135 || signal toolbar: convert signals&lt;br /&gt;
|-&lt;br /&gt;
|136 .. 137|| build rivers toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|138 .. 143 || OSK&lt;br /&gt;
|-&lt;br /&gt;
|144 || switch toolbar&lt;br /&gt;
|-&lt;br /&gt;
|145 .. 146 || build aqueduct toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|147 .. 148 || (+) and (-) icon&lt;br /&gt;
|-&lt;br /&gt;
|149 || window resize left&lt;br /&gt;
|-&lt;br /&gt;
|150 || play music right-to-left languages&lt;br /&gt;
|-&lt;br /&gt;
|151 .. 152 || shade / unshade&lt;br /&gt;
|-&lt;br /&gt;
|153 || debug&lt;br /&gt;
|-&lt;br /&gt;
|154 .. 157 || vehicle profit icons&lt;br /&gt;
|-&lt;br /&gt;
|158 || unread news&lt;br /&gt;
|-&lt;br /&gt;
|159 || exclusive transport rights&lt;br /&gt;
|-&lt;br /&gt;
|160 || autoreplace protection&lt;br /&gt;
|-&lt;br /&gt;
|161 || autoreplace defined&lt;br /&gt;
|-&lt;br /&gt;
|162 .. 165 || Town happiness indicator: N/A, appalling, mediocre and good&lt;br /&gt;
|-&lt;br /&gt;
|166 .. 167 || Icons for delete to the left resp. right&lt;br /&gt;
|-&lt;br /&gt;
|168 || Default window size&lt;br /&gt;
|-&lt;br /&gt;
|169 .. 173 || Story book: Main toolbar icon, goto place, unfinished goal, finished goal, broken goal&lt;br /&gt;
|-&lt;br /&gt;
|174 || Smallmap cargoflow button&lt;br /&gt;
|-&lt;br /&gt;
|175 .. 178 || Icons for group livery selection&lt;br /&gt;
|-&lt;br /&gt;
|179 .. 183 || NotRoadTypes toolbar and cursor icons&lt;br /&gt;
|-&lt;br /&gt;
|184 || {{ottd|1.11|g8dda0ec4f}} window title bar: rename vehicle/station/town/...&lt;br /&gt;
|-&lt;br /&gt;
|185 || {{ottd|1.11|g8dda0ec4f}} window title bar: go to location of vehicle/station/town/industry/...&lt;br /&gt;
|-&lt;br /&gt;
|186 .. 190 || {{ottd|1.12|gfda1a590f6}} multiplayer GUI: chat, admin action, join team, self player, host player&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 16 / 96 Airport preview sprites ====&lt;br /&gt;
[[File:airport_preview_commuter.png|right]]&lt;br /&gt;
Preview sprites for the airports in the order&lt;br /&gt;
# Small airport&lt;br /&gt;
# City airport&lt;br /&gt;
# Heliport&lt;br /&gt;
# Metropolitan airport&lt;br /&gt;
# International airport&lt;br /&gt;
# Commuter airport&lt;br /&gt;
# Heli depot&lt;br /&gt;
# Intercontinental airport&lt;br /&gt;
# Heli station&lt;br /&gt;
&lt;br /&gt;
Sprites are without any offsets and should all be the same size. Make sure so by using the forbid cropping.&lt;br /&gt;
&lt;br /&gt;
==== 17 / 97 Tunnel overlay sprites ====&lt;br /&gt;
[[File:tunnel_overlays.png|right]]&lt;br /&gt;
The sprites provide the ground for the tunnel sprites to be used by railtype NewGRFs which only need to provide the tunnel portals. They must be provided for both terrain types which could be used in any given climate (grass; grass+snow; grass+desert; grass).&lt;br /&gt;
&lt;br /&gt;
=== num-sprites ===&lt;br /&gt;
&lt;br /&gt;
The number of sprites that follow.&lt;br /&gt;
&lt;br /&gt;
Since TTDPatch 2.0.1 alpha 49, this value is an extended byte.&lt;br /&gt;
&lt;br /&gt;
Note that it is not generally an error to provide more sprites than required, but this does expend sprite slots unnecessarily.&lt;br /&gt;
&lt;br /&gt;
=== offset ===&lt;br /&gt;
&lt;br /&gt;
The offset in the Action 5 assignable block of sprites. This term is only read when bit 7 of the type has been set. It can be used to only replace a subset of sprites from a set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When creating a TTDPatch compatible grf, you have to skip the OpenTTD specific Action 05&#039;s using an Action 09 rather than an Action 07. Using the latter will result in an error on your Action 05 when using the grf in TTDPatch.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; NFORenum distinguishes Action5 with no offset and Action5 with offset 0. While they have technically the same effect, NFORenum assumes an Action5 with no offset has the intention to replace all sprites and checks the number of sprites accordingly. An Action5 with offset is considered to only replace a subset of the sprites, so the sprites are not checked for completeness.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Replace the piers for the aqueduct&lt;br /&gt;
 1457 * 3        05 12 02 06 // action5, type 12, 2 sprites, at offset 6 into that type&lt;br /&gt;
    9 sprites/png/terrain/waterfeatures.png 546 8 09 23 33 -26 0&lt;br /&gt;
   10 sprites/png/terrain/waterfeatures.png 594 8 09 23 33 -5 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Bridges&amp;diff=4388</id>
		<title>Action0/Bridges</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action0/Bridges&amp;diff=4388"/>
		<updated>2023-02-21T17:17:43Z</updated>

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

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

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

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

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

		<summary type="html">&lt;p&gt;Flherne: /* cargo-type */ add another OTTD 13 tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Action 3 assigns graphics sets (referenced to by (chains of) [[Action2|action 2(s]]) to feature IDs.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.10}} Roadtypes are available only in OpenTTD &amp;amp;gt; 1.10&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
The format of the data is feature-dependent. For roadtypes it looks like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &amp;amp;lt;Sprite-number&amp;amp;gt; * &amp;amp;lt;Length&amp;amp;gt; 03 12 &amp;amp;lt;n-id&amp;amp;gt; &amp;amp;lt;ids...&amp;amp;gt; &amp;amp;lt;num-cid&amp;amp;gt; &amp;amp;lt;cargo-type&amp;amp;gt; &amp;amp;lt;set-ID&amp;amp;gt;... &amp;amp;lt;default set-ID&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Element&#039;&#039;&#039;&lt;br /&gt;
![[GRFActionsDetailed|&#039;&#039;&#039;Size&#039;&#039;&#039;]]&lt;br /&gt;
!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;Sprite-number&amp;amp;gt;&lt;br /&gt;
|dec&lt;br /&gt;
|A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;length&amp;amp;gt;&lt;br /&gt;
|dec&lt;br /&gt;
|The total number of bytes used in this action&lt;br /&gt;
|-&lt;br /&gt;
|03&lt;br /&gt;
|B&lt;br /&gt;
|Defines action 03&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|B&lt;br /&gt;
|The feature byte for roadtypes&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;n-id&amp;amp;gt;&lt;br /&gt;
|B&lt;br /&gt;
|Number of IDs this action 3 associates graphics with&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;ids...&amp;amp;gt;&lt;br /&gt;
|B/B*&lt;br /&gt;
|IDs of the current feature this action 3 associates graphics with. There must be as many IDs as &amp;amp;lt;n-id&amp;amp;gt; specifies&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;num-cid&amp;amp;gt;&lt;br /&gt;
|B&lt;br /&gt;
|Number of different &amp;quot;cargo&amp;quot; types to support&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;cargo-type&amp;amp;gt;&lt;br /&gt;
|B&lt;br /&gt;
|&amp;quot;Cargo&amp;quot; type for which to use the following set-ID&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;set-ID&amp;amp;gt;&lt;br /&gt;
|W&lt;br /&gt;
|Set-ID (from action 2 or from a varaction2 chain) to use for this cargo type&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;default set-ID&amp;amp;gt;&lt;br /&gt;
|W&lt;br /&gt;
|Default set-ID to use if none of the above matches&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== n-id ===&lt;br /&gt;
&lt;br /&gt;
How many items of the current feature this action 3 defines new graphics for. If this is more than one, all items listed will get the same graphics. If this value has bit 7 set (i.e. 80 added), it is a wagon override. See [[Action3LiveryOverride|Action 3 - Livery Override]] for more info on this feature.&lt;br /&gt;
&lt;br /&gt;
You can make a definition with n-id equal to zero (and thus no ids that follow). &amp;amp;nbsp;This creates a generic feature-specific definition not associated with any particular item. &amp;amp;nbsp;At the moment, this is used for generic callbacks, but might be extended to other functions eventually.&lt;br /&gt;
&lt;br /&gt;
=== ids ===&lt;br /&gt;
&lt;br /&gt;
Feature IDs to use this action 3 for. All IDs are counted from the first of their class, i.e. the first road vehicle has 00, as does the first plane, the first ship, and the first train vehicle.&lt;br /&gt;
&lt;br /&gt;
=== num-cid ===&lt;br /&gt;
&lt;br /&gt;
Number of &amp;quot;cargo&amp;quot; type definitions that follow.&lt;br /&gt;
&lt;br /&gt;
=== cargo-type ===&lt;br /&gt;
&lt;br /&gt;
Roadtypes re-uses in its Action3 the &#039;cargo&#039;-type definition in order to assign the type of graphics defined by the associated set-ID:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;Cargo&#039; Type&lt;br /&gt;
!Sprite Type&lt;br /&gt;
!#Sprites&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|00&lt;br /&gt;
|Icons and cursors&lt;br /&gt;
|12&lt;br /&gt;
|4 road directions, autoroad, depot, tunnel and convert road. First all icons, then all cursors.&lt;br /&gt;
|-&lt;br /&gt;
|01&lt;br /&gt;
|Track overlays&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|19&lt;br /&gt;
|11 roadbit combinations, 4 slopes, and 4 dead ends. These sprites are optional for roadtypes.&lt;br /&gt;
|-&lt;br /&gt;
|02&lt;br /&gt;
|Underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
|19&lt;br /&gt;
|11 roadbit combinations, 4 slopes, and 4 dead ends. These sprites are required.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
|-&lt;br /&gt;
|03&lt;br /&gt;
|Tunnel&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
|4&lt;br /&gt;
|1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE. {{ottd|1.2|r23952}} If type 0A is defined as well, this sprite is used slightly different, see [[#Tunnel portal overlay (0A)|Tunnel portal overlay (0A)]].&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|04&lt;br /&gt;
|Catenary front&lt;br /&gt;
|29&lt;br /&gt;
|11 roadbit combinations, 4 slopes, 4 dead ends, 4 tunnels, 2 bridge middle, 4 bridge ramps&lt;br /&gt;
|-&lt;br /&gt;
|05&lt;br /&gt;
|Catenary back&lt;br /&gt;
|29&lt;br /&gt;
|11 roadbit combinations, 4 slopes, 4 dead ends, 4 tunnels (unused), 2 bridge middle, 4 bridge ramps&lt;br /&gt;
|-&lt;br /&gt;
|06&lt;br /&gt;
|Bridge surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
|6&lt;br /&gt;
|2 bridge middle, 4 bridge ramps&lt;br /&gt;
|-&lt;br /&gt;
|08&lt;br /&gt;
|Depots&lt;br /&gt;
|6&lt;br /&gt;
|Follows the original layout for depot sprites. If not present, the default depot sprites (depending on catenary flag) plus track overlay are drawn. If present, the depot sprites are expected to include track overlay graphics.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
|-&lt;br /&gt;
|0A&lt;br /&gt;
|Tunnel portal overlay&amp;lt;ref name=tunneloverlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|4&lt;br /&gt;
|{{ottd|1.2|r23952}} 1 sprite for each direction, order is SW, NW, NE, SE.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|0A&lt;br /&gt;
|Road stops&lt;br /&gt;
|4&lt;br /&gt;
|Overlays for drive-in road stops&lt;br /&gt;
|-&lt;br /&gt;
|0B&lt;br /&gt;
|One-way road arrows&lt;br /&gt;
|18&lt;br /&gt;
|{{ottd|13|}} Overlays for one-way roads: repeat (arrow facing SW, arrow NE, impassable NE-SW, arrow NW, arrow SE, impassable NW-SE) for flat, N corner raised, S corner raised.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== GUI sprites (00) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== Road underlay (02) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== Catenary front (04)====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_catenary_front.png]]&lt;br /&gt;
&lt;br /&gt;
==== Catenary back (05) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_catenary_back.png]]&lt;br /&gt;
&lt;br /&gt;
==== Depot sprites (08) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_depot.png]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Bridge surfaces (06) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_bridge.png]]&lt;br /&gt;
&lt;br /&gt;
==== Road stops (0A) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_drivein.png]]&lt;br /&gt;
&lt;br /&gt;
==== One-way road arrows (0B) ====&lt;br /&gt;
&lt;br /&gt;
Since {{ottd|13|}}.&lt;br /&gt;
[[File:Nrt_oneway.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
==== Tunnel portal overlay (0A) ====&lt;br /&gt;
&lt;br /&gt;
If this &#039;cargo&#039; type is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the sprite returned from type 03. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (0A). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
Variable 10 can be used to distinguish between several requested tunnel variations:&lt;br /&gt;
{| |-&lt;br /&gt;
! Lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 10]] !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || This is a plain portal without any extra features (like tracks above).&lt;br /&gt;
|-&lt;br /&gt;
| all other values || reserved for future extensions (e.g. basetunnels).&lt;br /&gt;
|}&lt;br /&gt;
The other bytes of variable 10 are reserved, and must be masked.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== default set-ID ===&lt;br /&gt;
&lt;br /&gt;
The default set-ID would be used for roadtype callbacks. However, since there are currently no callbacks for roadtypes it should always result in a [[Action2/Only_Callback_Failure|callback-failure]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action3/Roadtypes&amp;diff=4356</id>
		<title>Action3/Roadtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action3/Roadtypes&amp;diff=4356"/>
		<updated>2022-12-26T21:10:00Z</updated>

		<summary type="html">&lt;p&gt;Flherne: /* cargo-type */ add example oneway spritesheet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Action 3 assigns graphics sets (referenced to by (chains of) [[Action2|action 2(s]]) to feature IDs.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.10}} Roadtypes are available only in OpenTTD &amp;amp;gt; 1.10&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
The format of the data is feature-dependent. For roadtypes it looks like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &amp;amp;lt;Sprite-number&amp;amp;gt; * &amp;amp;lt;Length&amp;amp;gt; 03 12 &amp;amp;lt;n-id&amp;amp;gt; &amp;amp;lt;ids...&amp;amp;gt; &amp;amp;lt;num-cid&amp;amp;gt; &amp;amp;lt;cargo-type&amp;amp;gt; &amp;amp;lt;set-ID&amp;amp;gt;... &amp;amp;lt;default set-ID&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Element&#039;&#039;&#039;&lt;br /&gt;
![[GRFActionsDetailed|&#039;&#039;&#039;Size&#039;&#039;&#039;]]&lt;br /&gt;
!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;Sprite-number&amp;amp;gt;&lt;br /&gt;
|dec&lt;br /&gt;
|A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;length&amp;amp;gt;&lt;br /&gt;
|dec&lt;br /&gt;
|The total number of bytes used in this action&lt;br /&gt;
|-&lt;br /&gt;
|03&lt;br /&gt;
|B&lt;br /&gt;
|Defines action 03&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|B&lt;br /&gt;
|The feature byte for roadtypes&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;n-id&amp;amp;gt;&lt;br /&gt;
|B&lt;br /&gt;
|Number of IDs this action 3 associates graphics with&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;ids...&amp;amp;gt;&lt;br /&gt;
|B/B*&lt;br /&gt;
|IDs of the current feature this action 3 associates graphics with. There must be as many IDs as &amp;amp;lt;n-id&amp;amp;gt; specifies&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;num-cid&amp;amp;gt;&lt;br /&gt;
|B&lt;br /&gt;
|Number of different &amp;quot;cargo&amp;quot; types to support&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;cargo-type&amp;amp;gt;&lt;br /&gt;
|B&lt;br /&gt;
|&amp;quot;Cargo&amp;quot; type for which to use the following set-ID&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;set-ID&amp;amp;gt;&lt;br /&gt;
|W&lt;br /&gt;
|Set-ID (from action 2 or from a varaction2 chain) to use for this cargo type&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;default set-ID&amp;amp;gt;&lt;br /&gt;
|W&lt;br /&gt;
|Default set-ID to use if none of the above matches&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== n-id ===&lt;br /&gt;
&lt;br /&gt;
How many items of the current feature this action 3 defines new graphics for. If this is more than one, all items listed will get the same graphics. If this value has bit 7 set (i.e. 80 added), it is a wagon override. See [[Action3LiveryOverride|Action 3 - Livery Override]] for more info on this feature.&lt;br /&gt;
&lt;br /&gt;
You can make a definition with n-id equal to zero (and thus no ids that follow). &amp;amp;nbsp;This creates a generic feature-specific definition not associated with any particular item. &amp;amp;nbsp;At the moment, this is used for generic callbacks, but might be extended to other functions eventually.&lt;br /&gt;
&lt;br /&gt;
=== ids ===&lt;br /&gt;
&lt;br /&gt;
Feature IDs to use this action 3 for. All IDs are counted from the first of their class, i.e. the first road vehicle has 00, as does the first plane, the first ship, and the first train vehicle.&lt;br /&gt;
&lt;br /&gt;
=== num-cid ===&lt;br /&gt;
&lt;br /&gt;
Number of &amp;quot;cargo&amp;quot; type definitions that follow.&lt;br /&gt;
&lt;br /&gt;
=== cargo-type ===&lt;br /&gt;
&lt;br /&gt;
Roadtypes re-uses in its Action3 the &#039;cargo&#039;-type definition in order to assign the type of graphics defined by the associated set-ID:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;Cargo&#039; Type&lt;br /&gt;
!Sprite Type&lt;br /&gt;
!#Sprites&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|00&lt;br /&gt;
|Icons and cursors&lt;br /&gt;
|12&lt;br /&gt;
|4 road directions, autoroad, depot, tunnel and convert road. First all icons, then all cursors.&lt;br /&gt;
|-&lt;br /&gt;
|01&lt;br /&gt;
|Track overlays&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|19&lt;br /&gt;
|11 roadbit combinations, 4 slopes, and 4 dead ends. These sprites are optional for roadtypes.&lt;br /&gt;
|-&lt;br /&gt;
|02&lt;br /&gt;
|Underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
|19&lt;br /&gt;
|11 roadbit combinations, 4 slopes, and 4 dead ends. These sprites are required.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
|-&lt;br /&gt;
|03&lt;br /&gt;
|Tunnel&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
|4&lt;br /&gt;
|1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE. {{ottd|1.2|r23952}} If type 0A is defined as well, this sprite is used slightly different, see [[#Tunnel portal overlay (0A)|Tunnel portal overlay (0A)]].&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|04&lt;br /&gt;
|Catenary front&lt;br /&gt;
|29&lt;br /&gt;
|11 roadbit combinations, 4 slopes, 4 dead ends, 4 tunnels, 2 bridge middle, 4 bridge ramps&lt;br /&gt;
|-&lt;br /&gt;
|05&lt;br /&gt;
|Catenary back&lt;br /&gt;
|29&lt;br /&gt;
|11 roadbit combinations, 4 slopes, 4 dead ends, 4 tunnels (unused), 2 bridge middle, 4 bridge ramps&lt;br /&gt;
|-&lt;br /&gt;
|06&lt;br /&gt;
|Bridge surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
|6&lt;br /&gt;
|2 bridge middle, 4 bridge ramps&lt;br /&gt;
|-&lt;br /&gt;
|08&lt;br /&gt;
|Depots&lt;br /&gt;
|6&lt;br /&gt;
|Follows the original layout for depot sprites. If not present, the default depot sprites (depending on catenary flag) plus track overlay are drawn. If present, the depot sprites are expected to include track overlay graphics.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
|-&lt;br /&gt;
|0A&lt;br /&gt;
|Tunnel portal overlay&amp;lt;ref name=tunneloverlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|4&lt;br /&gt;
|{{ottd|1.2|r23952}} 1 sprite for each direction, order is SW, NW, NE, SE.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|0A&lt;br /&gt;
|Road stops&lt;br /&gt;
|4&lt;br /&gt;
|Overlays for drive-in road stops&lt;br /&gt;
|-&lt;br /&gt;
|0B&lt;br /&gt;
|One-way road arrows&lt;br /&gt;
|18&lt;br /&gt;
|{{ottd|13|}} Overlays for one-way roads: repeat (arrow facing SW, arrow NE, impassable NE-SW, arrow NW, arrow SE, impassable NW-SE) for flat, N corner raised, S corner raised.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== GUI sprites (00) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== Road underlay (02) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== Catenary front (04)====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_catenary_front.png]]&lt;br /&gt;
&lt;br /&gt;
==== Catenary back (05) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_catenary_back.png]]&lt;br /&gt;
&lt;br /&gt;
==== Depot sprites (08) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_depot.png]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Bridge surfaces (06) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_bridge.png]]&lt;br /&gt;
&lt;br /&gt;
==== Road stops (0A) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_drivein.png]]&lt;br /&gt;
&lt;br /&gt;
==== One-way road arrows (0B) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_oneway.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
==== Tunnel portal overlay (0A) ====&lt;br /&gt;
&lt;br /&gt;
If this &#039;cargo&#039; type is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the sprite returned from type 03. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (0A). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
Variable 10 can be used to distinguish between several requested tunnel variations:&lt;br /&gt;
{| |-&lt;br /&gt;
! Lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 10]] !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || This is a plain portal without any extra features (like tracks above).&lt;br /&gt;
|-&lt;br /&gt;
| all other values || reserved for future extensions (e.g. basetunnels).&lt;br /&gt;
|}&lt;br /&gt;
The other bytes of variable 10 are reserved, and must be masked.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== default set-ID ===&lt;br /&gt;
&lt;br /&gt;
The default set-ID would be used for roadtype callbacks. However, since there are currently no callbacks for roadtypes it should always result in a [[Action2/Only_Callback_Failure|callback-failure]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=File:Nrt_oneway.png&amp;diff=4352</id>
		<title>File:Nrt oneway.png</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=File:Nrt_oneway.png&amp;diff=4352"/>
		<updated>2022-12-26T21:07:59Z</updated>

		<summary type="html">&lt;p&gt;Flherne: One-way overlay sprites for OpenTTD &amp;gt;=13 (openttd.grf version)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
One-way overlay sprites for OpenTTD &amp;gt;=13 (openttd.grf version)&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action3/Roadtypes&amp;diff=4347</id>
		<title>Action3/Roadtypes</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action3/Roadtypes&amp;diff=4347"/>
		<updated>2022-12-26T21:04:53Z</updated>

		<summary type="html">&lt;p&gt;Flherne: /* cargo-type */ Add 0B one-way road arrows to table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Action 3 assigns graphics sets (referenced to by (chains of) [[Action2|action 2(s]]) to feature IDs.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|1.10}} Roadtypes are available only in OpenTTD &amp;amp;gt; 1.10&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
The format of the data is feature-dependent. For roadtypes it looks like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &amp;amp;lt;Sprite-number&amp;amp;gt; * &amp;amp;lt;Length&amp;amp;gt; 03 12 &amp;amp;lt;n-id&amp;amp;gt; &amp;amp;lt;ids...&amp;amp;gt; &amp;amp;lt;num-cid&amp;amp;gt; &amp;amp;lt;cargo-type&amp;amp;gt; &amp;amp;lt;set-ID&amp;amp;gt;... &amp;amp;lt;default set-ID&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Element&#039;&#039;&#039;&lt;br /&gt;
![[GRFActionsDetailed|&#039;&#039;&#039;Size&#039;&#039;&#039;]]&lt;br /&gt;
!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;Sprite-number&amp;amp;gt;&lt;br /&gt;
|dec&lt;br /&gt;
|A sequential sprite number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;length&amp;amp;gt;&lt;br /&gt;
|dec&lt;br /&gt;
|The total number of bytes used in this action&lt;br /&gt;
|-&lt;br /&gt;
|03&lt;br /&gt;
|B&lt;br /&gt;
|Defines action 03&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|B&lt;br /&gt;
|The feature byte for roadtypes&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;n-id&amp;amp;gt;&lt;br /&gt;
|B&lt;br /&gt;
|Number of IDs this action 3 associates graphics with&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;ids...&amp;amp;gt;&lt;br /&gt;
|B/B*&lt;br /&gt;
|IDs of the current feature this action 3 associates graphics with. There must be as many IDs as &amp;amp;lt;n-id&amp;amp;gt; specifies&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;num-cid&amp;amp;gt;&lt;br /&gt;
|B&lt;br /&gt;
|Number of different &amp;quot;cargo&amp;quot; types to support&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;cargo-type&amp;amp;gt;&lt;br /&gt;
|B&lt;br /&gt;
|&amp;quot;Cargo&amp;quot; type for which to use the following set-ID&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;set-ID&amp;amp;gt;&lt;br /&gt;
|W&lt;br /&gt;
|Set-ID (from action 2 or from a varaction2 chain) to use for this cargo type&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;lt;default set-ID&amp;amp;gt;&lt;br /&gt;
|W&lt;br /&gt;
|Default set-ID to use if none of the above matches&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== n-id ===&lt;br /&gt;
&lt;br /&gt;
How many items of the current feature this action 3 defines new graphics for. If this is more than one, all items listed will get the same graphics. If this value has bit 7 set (i.e. 80 added), it is a wagon override. See [[Action3LiveryOverride|Action 3 - Livery Override]] for more info on this feature.&lt;br /&gt;
&lt;br /&gt;
You can make a definition with n-id equal to zero (and thus no ids that follow). &amp;amp;nbsp;This creates a generic feature-specific definition not associated with any particular item. &amp;amp;nbsp;At the moment, this is used for generic callbacks, but might be extended to other functions eventually.&lt;br /&gt;
&lt;br /&gt;
=== ids ===&lt;br /&gt;
&lt;br /&gt;
Feature IDs to use this action 3 for. All IDs are counted from the first of their class, i.e. the first road vehicle has 00, as does the first plane, the first ship, and the first train vehicle.&lt;br /&gt;
&lt;br /&gt;
=== num-cid ===&lt;br /&gt;
&lt;br /&gt;
Number of &amp;quot;cargo&amp;quot; type definitions that follow.&lt;br /&gt;
&lt;br /&gt;
=== cargo-type ===&lt;br /&gt;
&lt;br /&gt;
Roadtypes re-uses in its Action3 the &#039;cargo&#039;-type definition in order to assign the type of graphics defined by the associated set-ID:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;Cargo&#039; Type&lt;br /&gt;
!Sprite Type&lt;br /&gt;
!#Sprites&lt;br /&gt;
!Useage&lt;br /&gt;
|-&lt;br /&gt;
|00&lt;br /&gt;
|Icons and cursors&lt;br /&gt;
|12&lt;br /&gt;
|4 road directions, autoroad, depot, tunnel and convert road. First all icons, then all cursors.&lt;br /&gt;
|-&lt;br /&gt;
|01&lt;br /&gt;
|Track overlays&amp;lt;ref name=leftout&amp;gt;Either all or none of these sprites should be provided.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|19&lt;br /&gt;
|11 roadbit combinations, 4 slopes, and 4 dead ends. These sprites are optional for roadtypes.&lt;br /&gt;
|-&lt;br /&gt;
|02&lt;br /&gt;
|Underlay&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
|19&lt;br /&gt;
|11 roadbit combinations, 4 slopes, and 4 dead ends. These sprites are required.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
|-&lt;br /&gt;
|03&lt;br /&gt;
|Tunnel&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
|4&lt;br /&gt;
|1 sprite for each direction. Sprite is overlay for track in existing tunnel graphics. The original ground sprite is drawn, then the overlay, then possibly a train and the original tunnel head is drawn over the top. This keeps compatibility with different landscape types. Sprite order: SW, NW, NE, SE. {{ottd|1.2|r23952}} If type 0A is defined as well, this sprite is used slightly different, see [[#Tunnel portal overlay (0A)|Tunnel portal overlay (0A)]].&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|04&lt;br /&gt;
|Catenary front&lt;br /&gt;
|29&lt;br /&gt;
|11 roadbit combinations, 4 slopes, 4 dead ends, 4 tunnels, 2 bridge middle, 4 bridge ramps&lt;br /&gt;
|-&lt;br /&gt;
|05&lt;br /&gt;
|Catenary back&lt;br /&gt;
|29&lt;br /&gt;
|11 roadbit combinations, 4 slopes, 4 dead ends, 4 tunnels (unused), 2 bridge middle, 4 bridge ramps&lt;br /&gt;
|-&lt;br /&gt;
|06&lt;br /&gt;
|Bridge surfaces&amp;lt;ref name=leftout /&amp;gt;&lt;br /&gt;
|6&lt;br /&gt;
|2 bridge middle, 4 bridge ramps&lt;br /&gt;
|-&lt;br /&gt;
|08&lt;br /&gt;
|Depots&lt;br /&gt;
|6&lt;br /&gt;
|Follows the original layout for depot sprites. If not present, the default depot sprites (depending on catenary flag) plus track overlay are drawn. If present, the depot sprites are expected to include track overlay graphics.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
|-&lt;br /&gt;
|0A&lt;br /&gt;
|Tunnel portal overlay&amp;lt;ref name=tunneloverlay&amp;gt;Above &#039;all or none&#039; sprites must be supplied, if these sprites are to be used.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|4&lt;br /&gt;
|{{ottd|1.2|r23952}} 1 sprite for each direction, order is SW, NW, NE, SE.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|0A&lt;br /&gt;
|Road stops&lt;br /&gt;
|4&lt;br /&gt;
|Overlays for drive-in road stops&lt;br /&gt;
|-&lt;br /&gt;
|0B&lt;br /&gt;
|One-way road arrows&lt;br /&gt;
|18&lt;br /&gt;
|{{ottd|13|}}Overlays for one-way roads: repeat (arrow facing SW, arrow NE, impassable NE-SW, arrow NW, arrow SE, impassable NW-SE) for flat, N corner raised, S corner raised.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== GUI sprites (00) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_gui.png]]&lt;br /&gt;
&lt;br /&gt;
==== Road underlay (02) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_underlay.png]]&lt;br /&gt;
&lt;br /&gt;
==== Catenary front (04)====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_catenary_front.png]]&lt;br /&gt;
&lt;br /&gt;
==== Catenary back (05) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_catenary_back.png]]&lt;br /&gt;
&lt;br /&gt;
==== Depot sprites (08) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_depot.png]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
!Sprite Number&lt;br /&gt;
!Usage&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NE wall for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;NW wall for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for SW-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NE-entry depot.&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
| &amp;amp;nbsp; &amp;amp;nbsp;Depot building for NW-entry depot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Bridge surfaces (06) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_bridge.png]]&lt;br /&gt;
&lt;br /&gt;
==== Road stops (0A) ====&lt;br /&gt;
&lt;br /&gt;
[[File:Nrt_drivein.png]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
==== Tunnel portal overlay (0A) ====&lt;br /&gt;
&lt;br /&gt;
If this &#039;cargo&#039; type is defined, tunnels for this railtype will be drawn differently.&lt;br /&gt;
&lt;br /&gt;
First, a grass underlay base sprite is drawn, then the sprite returned from type 03. Next, train sprites if applicable and then a grass overlay and finally the sprite from this type (0A). The grass sprites are defined in the base set and do not contain any parts of the tracks or portal, so these have to be fully provided by the railtype sprites.&lt;br /&gt;
&lt;br /&gt;
Illustration: [[File:RailtypeTunnelExample.png]]&lt;br /&gt;
&lt;br /&gt;
Variable 10 can be used to distinguish between several requested tunnel variations:&lt;br /&gt;
{| |-&lt;br /&gt;
! Lowest byte of [[GlobalVariables#Extra_callback_info_.2810_.2F_-.29_and_.2818_.2F_-.29|variable 10]] !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 00 || This is a plain portal without any extra features (like tracks above).&lt;br /&gt;
|-&lt;br /&gt;
| all other values || reserved for future extensions (e.g. basetunnels).&lt;br /&gt;
|}&lt;br /&gt;
The other bytes of variable 10 are reserved, and must be masked.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== default set-ID ===&lt;br /&gt;
&lt;br /&gt;
The default set-ID would be used for roadtype callbacks. However, since there are currently no callbacks for roadtypes it should always result in a [[Action2/Only_Callback_Failure|callback-failure]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4342</id>
		<title>Action5</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4342"/>
		<updated>2022-12-26T20:59:21Z</updated>

		<summary type="html">&lt;p&gt;Flherne: /* 09 One-way road arrows */ minor tweaks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define base graphics specific sets&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Action 5 is used to define graphics for several new features of OpenTTD and TTDPatch. This is similar to action 1.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 05 &amp;lt;type&amp;gt; &amp;lt;num-sprites&amp;gt; [&amp;lt;offset&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Sprite-number&amp;gt;||dec||A sequential sprite number&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;||dec||The total number of bytes used in this action&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05||B||Defines action 05&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;type&amp;gt;||B||What type of graphics follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;num-sprites&amp;gt;||B*||How many regular sprites follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;offset&amp;gt;||B*||Offset in the Action 5 assignable block of sprites&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following num-sprites sprites in the .nfo file have to be RealSprites that will be used as graphics for the given TTDPatch feature, except for type 0A, which requires RecolorSprites.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|2.5|ttdprev=alpha 19}}Action 5 entries in a .grf file which has a regular GRFID (not FFFFFFFF) will always override those from .grf files with a GRFID of FFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== type ===&lt;br /&gt;
&lt;br /&gt;
This sets the type of feature that the graphics are for. If bit 7 is set, the offset variable needs to be set. Bit 7 may only be set if the type supports it. The type can be one of:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Type!!Version!!Feature!!num-sprites (decimal)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal and semaphore graphics||112&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04,84&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Offset allowed since {{ottdp|1.2|no|ottdrev=r23005}}&amp;lt;/ref&amp;gt;||{{ottdp| |2.5|ttdprev=alpha 41}}||Pre-signal, semaphore, and PBS graphics||240&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05,85&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.0}}||Overhead wires and pylon graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06 ||{{ottdp|0.6| }}||Foundations (retaining walls) for BuildOnSlopes ||74&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06,86&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11321}}||Foundations for BuildOnSlopes and half tiles (NS and EW foundations) ||90&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|07||{{ottdp|no|2.5|ttdprev=alpha 43}}||TTDPatch GUI sprites||93 &amp;lt;ref&amp;gt;Type 07 only requires 73 sprites in the stable (2.5 branch); the extra sprites are the clone train and build canal cursors.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|08,88&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no}}&amp;lt;ref&amp;gt;TTDPatch supported canals via Action5 from 2.0.1 alpha 17 up to alpha 25. In alpha 26 it was removed again in favour of an action-1-2-3 method; see [[Action3/Canals|Action3]]. The method via Action5 is no longer supported by TTDpatch 2.0.1 alpha 26 and newer.&amp;lt;/ref&amp;gt;||Canals||65&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|09,89&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 58}}||One-way road arrows||{{ottdp|13|no}} 18 {{ottdp|0.6 - 12|2.5}} 6&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0A,8A&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 67}}||Two company color translation maps||256&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0B,8B&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 68}}||Tram tracks||{{ottdp|1.10|no}} 119 {{ottdp|0.6 - 1.9|2.5}} 113&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0C||{{ottdp|no|2.5|ttdprev=alpha 74}}||Snowy temperate trees||133&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0D||{{ottdp|0.6|2.5|ottdrev=r7325 (r11726)|ttdprev=beta 5}}||Coast Tile graphics||16 (18)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0E||{{ottdp|no|2.6|ttdprev=r1247}}||New Signals||Any&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0F,8F&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13469|ttdprev=r1487}}||Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP)||Up to 12&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|10,90&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r9645}}||Additional airport graphics||15&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|11,91&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.6|ottdrev=r9645|ttdprev=r1589}}||Road stop graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12,92&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13464|ttdprev=r1498}}||Aqueduct graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|13,93&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11433}}||Autorail sprites||55&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|14,94||{{ottdp|0.6 - 1.11|no|ottdrev=11433}}||Flag sprites (no longer used)||Up to 36&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|15,95||{{ottdp|0.6|no|ottdrev=r11433}}||OpenTTD GUI sprites||Up to 191&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|16,96||{{ottdp|1.1|no|ottdrev=r20370}}||Airport preview sprites||Up to 9&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|17,97||{{ottdp|1.2|no|ottdrev=r23952}}||Railtype tunnel base sprites||16&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|18,98||{{ottdp|1.5|no|ottdrev=r26869}}||Extra all black palette||1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 04 Signal graphics. ====&lt;br /&gt;
&lt;br /&gt;
Signal graphics come in groups of 16. These groups contain sprites in the same order as sprites 1275-1290 in trg1[r].grf; red, then green, for each of: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Group(s)!!Contents&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0||lighted entrance signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|1||lighted exit signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|2||lighted combo signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3||standard (non-pre-signal) semaphore signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4..6||repeat 0..2 for semaphores&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|7||standard lighted PBS signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|8..14||repeat 0..6 for PBS signals&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 09 One-way road arrows ====&lt;br /&gt;
&lt;br /&gt;
Overlay sprites to indicate the direction of one-way roads.&lt;br /&gt;
The 6 sprites originally supported from {{ottdp|0.6|2.5}} are, in order:&lt;br /&gt;
&lt;br /&gt;
 arrow facing SW, arrow NE, impassable NE-SW, arrow NW, arrow SE, impassable NW-SE.&lt;br /&gt;
&lt;br /&gt;
Before {{ottdp|13|no}} these are used on both flat and sloped roads. From {{ottdp|13|no}} an additional 12 sprites are supported:&lt;br /&gt;
The above sequence repeated for slopes with the N corner raised, and then for slopes with the S corner raised.&lt;br /&gt;
&lt;br /&gt;
==== 0C Snowy temperate trees ====&lt;br /&gt;
&lt;br /&gt;
If the temperate snow line is enabled, you can use this to specify the snowy versions of temperate trees. The sprites must be the snowy versions of sprites 1576-1708 from TRG1.GRF, in the same order as they appear there.&lt;br /&gt;
&lt;br /&gt;
==== 0D Coast tile sprites ====&lt;br /&gt;
&lt;br /&gt;
===== In NewGRFs =====&lt;br /&gt;
If diagonal flooding is enabled then due to new corner coasts, you can use this to give a complete set of replacement coast tile sprites. There are 16 in total, 8 original Transport Tycoon Deluxe sprites and 8 for the corner slopes. Order of the sprites&amp;lt;ref name=numbers&amp;gt;Sprite numbers from trg1(r).pcx.&amp;lt;/ref&amp;gt; is as follows:&lt;br /&gt;
&lt;br /&gt;
 3997, 4063, 4064, 4068, 4062, 3998, 4066, 3988,&lt;br /&gt;
 4065, 4069, 3996, 3992, 4067, 3994, 3995, 3999.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast16Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The 16 sprites for feature 0D&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== In Base Set&#039;s extra grf =====&lt;br /&gt;
Additionally, OpenTTD (since r11726) supports another method of supplying all additional coast tile sprites, but this is only allowed in the &#039;&#039;extra&#039;&#039; NewGRF of [http://wiki.openttd.org/Base_graphics Base Graphic Sets]. In this, only 10 sprites are supplied in the same order as the 16 sprites above, but without the coast sprites already in the base grf. Note that the 10 sprites version supplies two additional slopes, but they are not used, and are currently unlikely to be ever used.&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast10Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Only 10 sprites are required for OpenTTD base graphic sets&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In OpenTTD 10 sprites for type 0D is enough in base graphic sets. The 16 sprites version should not be used for base graphics.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason for the existence of a 10 sprite version is to remove the need for including original graphics, and to keep compatibility with old NewGRFs that replace the original shore graphics using Action A without adding new shores using Action 5: When a NewGRF uses the 16 sprites version it takes precedence above any NewGRF replacing the shore graphics using Action A; when a NewGRF uses Action A to replace shore graphics it takes precedence above a 10-sprite Action 5, effectively disabling diagonal flooding. Also due to compatibility the 10 sprites version is invalid for normal NewGRFs, which are not the &amp;quot;extra&amp;quot; NewGRF of some Base Graphics Set.&lt;br /&gt;
&lt;br /&gt;
==== 0E New Signals ====&lt;br /&gt;
&lt;br /&gt;
Any number of real and recolour sprites can be specified in the action in any order.&lt;br /&gt;
&lt;br /&gt;
Sprites are referenced by their offset into the action5 block by a [[VarAction2NewSignals]], hence a logically easily calculable order is advised.&lt;br /&gt;
&lt;br /&gt;
As of TTDPatch 2.6 alpha 0 r1346, the action 5 block defined in the same GRF file as the varaction2, will be used as the base sprite block for the offsets returned by the callback even if it is overridden by a higher priority GRF action 5 definition of the same feature (0E).&lt;br /&gt;
&lt;br /&gt;
==== 0F Tracks for Slopes ====&lt;br /&gt;
&lt;br /&gt;
This should be in the same order as sprites 1031 to 1035 (1). These should only be the rails, basically the same format as sprites 1005 to 1010 (1). There should be 3 groups of these sprites, one for each rail type (railroad, monorail, maglev).&lt;br /&gt;
&lt;br /&gt;
(1) Sprite numbers from trg1r.pcx / ogfx1_base.grf&lt;br /&gt;
&lt;br /&gt;
==== 11 Road stop graphics ====&lt;br /&gt;
&lt;br /&gt;
Road stop graphics consist of 2 groups of 4 sprites. The first group contains graphics for bus stops, second for truck stops. In each group, the sprites are in the following order: SW, NE, NW, SE.&lt;br /&gt;
&lt;br /&gt;
SW and NE sprites are used with road going along the Y axis ( .\&#039; ), NW and SE with road along the X axis( &#039;/. ).&lt;br /&gt;
&lt;br /&gt;
Internally, the stations are defined using the following station layouts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1313&lt;br /&gt;
&lt;br /&gt;
\b13 \b0 \b0 \b3 \b16 \b16 &amp;lt;SW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b3 \b16 \b16 &amp;lt;NE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1314&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b16 \b3 \b16 &amp;lt;NW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b13 \b0 \b16 \b3 \b16 &amp;lt;SE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where 1313 and 1314 are town road sprites.&lt;br /&gt;
&lt;br /&gt;
[[File:roadstops.png]]&lt;br /&gt;
&lt;br /&gt;
Further sprites can be found in &#039;&#039;&#039;openttd.grf&#039;&#039;&#039; (OpenTTD), &#039;&#039;&#039;ogfxe_extra.grf&#039;&#039;&#039; (OpenGFX) or &#039;&#039;&#039;ttdpbase(w).grf&#039;&#039;&#039; (TTDPatch).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As of OpenTTD r10185, the behaviour of this feature is identical in both games.&lt;br /&gt;
&lt;br /&gt;
==== 12 Aqueducts ====&lt;br /&gt;
&lt;br /&gt;
8 real sprites should be given. Firstly: 4 bridge end sprites in the order: SW, SE, NE, NW, where the direction is that heading onto the aqueduct. Then 2 middle part sprites for the X and Y directions. Followed by two pillar sprites for the X and Y directions. For examples of where the division between middle sprites and pillars should be made see sprites 2437 to 2592 (1), or an existing aqueduct GRF. Note, that for higher bridges to work effectively, pillars should be approximately 8px in height.&lt;br /&gt;
&lt;br /&gt;
[[File:aqueduct.png]]&lt;br /&gt;
&lt;br /&gt;
==== 15 / 95 OpenTTD GUI sprites ====&lt;br /&gt;
&lt;br /&gt;
OpenTTD defines 190 GUI sprites. Additional sprites not needed by an OpenTTD are simply ignored, so that new(er) base sets can be used by old OpenTTD versions. One can (re-)define a subset of the GUI sprites by giving an offset into the GUI sprites. The sprites are:&lt;br /&gt;
{|&lt;br /&gt;
!Offset !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0 .. 11|| Halftile selections&lt;br /&gt;
|-&lt;br /&gt;
|12 .. 13 || Title screen letters E and D&lt;br /&gt;
|-&lt;br /&gt;
|14 .. 37 || Bridge piers colours 1 .. 4&lt;br /&gt;
|-&lt;br /&gt;
|38 || square indicating NewGRF compatibility&lt;br /&gt;
|-&lt;br /&gt;
|39 || blob indicating server compatibility&lt;br /&gt;
|-&lt;br /&gt;
|40 || lock icon&lt;br /&gt;
|-&lt;br /&gt;
|41 || empty check box&lt;br /&gt;
|-&lt;br /&gt;
|42 || checked check box&lt;br /&gt;
|-&lt;br /&gt;
|43 || warning sign&lt;br /&gt;
|-&lt;br /&gt;
|44 || window resize right&lt;br /&gt;
|-&lt;br /&gt;
|45 .. 48|| arrows&lt;br /&gt;
|-&lt;br /&gt;
|49 || house&lt;br /&gt;
|-&lt;br /&gt;
|50 || shared orders&lt;br /&gt;
|-&lt;br /&gt;
|51 .. 52 || pin / pinned&lt;br /&gt;
|-&lt;br /&gt;
|53 .. 62 || rail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|63 .. 68 || monorail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|69 .. 74 || maglev build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|75 || ??&lt;br /&gt;
|-&lt;br /&gt;
|76 .. 77 || waypoint toolbar and cursor icon&lt;br /&gt;
|-&lt;br /&gt;
|78 .. 81 || waypoint buildings&lt;br /&gt;
|-&lt;br /&gt;
|82 .. 85 || autoroad toobar and cursor for road and trams&lt;br /&gt;
|-&lt;br /&gt;
|86 || helipad&lt;br /&gt;
|-&lt;br /&gt;
|87 || build ship lift cursor&lt;br /&gt;
|-&lt;br /&gt;
|88 .. 89 || build canal toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|90 || fast forward&lt;br /&gt;
|-&lt;br /&gt;
|91 .. 92 || level land toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|93 .. 96 || sell vehicle&lt;br /&gt;
|-&lt;br /&gt;
|97 .. 100 || sell all vehicles&lt;br /&gt;
|-&lt;br /&gt;
|101 .. 104 || replace vehicle&lt;br /&gt;
|-&lt;br /&gt;
|105 || sell chain of rail vehicles&lt;br /&gt;
|-&lt;br /&gt;
|106 .. 113 || clone vehicles button and cursors&lt;br /&gt;
|-&lt;br /&gt;
|114 .. 117 || create vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|118 .. 121 || delete vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|122 .. 125 || rename vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|126 .. 133 || group replace on / off button&lt;br /&gt;
|-&lt;br /&gt;
|134 || road toolbar: build one-way roads&lt;br /&gt;
|-&lt;br /&gt;
|135 || signal toolbar: convert signals&lt;br /&gt;
|-&lt;br /&gt;
|136 .. 137|| build rivers toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|138 .. 143 || OSK&lt;br /&gt;
|-&lt;br /&gt;
|144 || switch toolbar&lt;br /&gt;
|-&lt;br /&gt;
|145 .. 146 || build aqueduct toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|147 .. 148 || (+) and (-) icon&lt;br /&gt;
|-&lt;br /&gt;
|149 || window resize left&lt;br /&gt;
|-&lt;br /&gt;
|150 || play music right-to-left languages&lt;br /&gt;
|-&lt;br /&gt;
|151 .. 152 || shade / unshade&lt;br /&gt;
|-&lt;br /&gt;
|153 || debug&lt;br /&gt;
|-&lt;br /&gt;
|154 .. 157 || vehicle profit icons&lt;br /&gt;
|-&lt;br /&gt;
|158 || unread news&lt;br /&gt;
|-&lt;br /&gt;
|159 || exclusive transport rights&lt;br /&gt;
|-&lt;br /&gt;
|160 || autoreplace protection&lt;br /&gt;
|-&lt;br /&gt;
|161 || autoreplace defined&lt;br /&gt;
|-&lt;br /&gt;
|162 .. 165 || Town happiness indicator: N/A, appalling, mediocre and good&lt;br /&gt;
|-&lt;br /&gt;
|166 .. 167 || Icons for delete to the left resp. right&lt;br /&gt;
|-&lt;br /&gt;
|168 || Default window size&lt;br /&gt;
|-&lt;br /&gt;
|169 .. 173 || Story book: Main toolbar icon, goto place, unfinished goal, finished goal, broken goal&lt;br /&gt;
|-&lt;br /&gt;
|174 || Smallmap cargoflow button&lt;br /&gt;
|-&lt;br /&gt;
|175 .. 178 || Icons for group livery selection&lt;br /&gt;
|-&lt;br /&gt;
|179 .. 183 || NotRoadTypes toolbar and cursor icons&lt;br /&gt;
|-&lt;br /&gt;
|184 || {{ottd|1.11|g8dda0ec4f}} window title bar: rename vehicle/station/town/...&lt;br /&gt;
|-&lt;br /&gt;
|185 || {{ottd|1.11|g8dda0ec4f}} window title bar: go to location of vehicle/station/town/industry/...&lt;br /&gt;
|-&lt;br /&gt;
|186 .. 190 || {{ottd|1.12|gfda1a590f6}} multiplayer GUI: chat, admin action, join team, self player, host player&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 16 / 96 Airport preview sprites ====&lt;br /&gt;
[[File:airport_preview_commuter.png|right]]&lt;br /&gt;
Preview sprites for the airports in the order&lt;br /&gt;
# Small airport&lt;br /&gt;
# City airport&lt;br /&gt;
# Heliport&lt;br /&gt;
# Metropolitan airport&lt;br /&gt;
# International airport&lt;br /&gt;
# Commuter airport&lt;br /&gt;
# Heli depot&lt;br /&gt;
# Intercontinental airport&lt;br /&gt;
# Heli station&lt;br /&gt;
&lt;br /&gt;
Sprites are without any offsets and should all be the same size. Make sure so by using the forbid cropping.&lt;br /&gt;
&lt;br /&gt;
==== 17 / 97 Tunnel overlay sprites ====&lt;br /&gt;
[[File:tunnel_overlays.png|right]]&lt;br /&gt;
The sprites provide the ground for the tunnel sprites to be used by railtype NewGRFs which only need to provide the tunnel portals. They must be provided for both terrain types which could be used in any given climate (grass; grass+snow; grass+desert; grass).&lt;br /&gt;
&lt;br /&gt;
=== num-sprites ===&lt;br /&gt;
&lt;br /&gt;
The number of sprites that follow.&lt;br /&gt;
&lt;br /&gt;
Since TTDPatch 2.0.1 alpha 49, this value is an extended byte.&lt;br /&gt;
&lt;br /&gt;
Note that it is not generally an error to provide more sprites than required, but this does expend sprite slots unnecessarily.&lt;br /&gt;
&lt;br /&gt;
=== offset ===&lt;br /&gt;
&lt;br /&gt;
The offset in the Action 5 assignable block of sprites. This term is only read when bit 7 of the type has been set. It can be used to only replace a subset of sprites from a set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When creating a TTDPatch compatible grf, you have to skip the OpenTTD specific Action 05&#039;s using an Action 09 rather than an Action 07. Using the latter will result in an error on your Action 05 when using the grf in TTDPatch.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; NFORenum distinguishes Action5 with no offset and Action5 with offset 0. While they have technically the same effect, NFORenum assumes an Action5 with no offset has the intention to replace all sprites and checks the number of sprites accordingly. An Action5 with offset is considered to only replace a subset of the sprites, so the sprites are not checked for completeness.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Replace the piers for the aqueduct&lt;br /&gt;
 1457 * 3        05 12 02 06 // action5, type 12, 2 sprites, at offset 6 into that type&lt;br /&gt;
    9 sprites/png/terrain/waterfeatures.png 546 8 09 23 33 -26 0&lt;br /&gt;
   10 sprites/png/terrain/waterfeatures.png 594 8 09 23 33 -5 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4339</id>
		<title>Action5</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4339"/>
		<updated>2022-12-26T20:55:58Z</updated>

		<summary type="html">&lt;p&gt;Flherne: Describe 09 One-way road arrows&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define base graphics specific sets&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Action 5 is used to define graphics for several new features of OpenTTD and TTDPatch. This is similar to action 1.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 05 &amp;lt;type&amp;gt; &amp;lt;num-sprites&amp;gt; [&amp;lt;offset&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Sprite-number&amp;gt;||dec||A sequential sprite number&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;||dec||The total number of bytes used in this action&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05||B||Defines action 05&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;type&amp;gt;||B||What type of graphics follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;num-sprites&amp;gt;||B*||How many regular sprites follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;offset&amp;gt;||B*||Offset in the Action 5 assignable block of sprites&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following num-sprites sprites in the .nfo file have to be RealSprites that will be used as graphics for the given TTDPatch feature, except for type 0A, which requires RecolorSprites.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|2.5|ttdprev=alpha 19}}Action 5 entries in a .grf file which has a regular GRFID (not FFFFFFFF) will always override those from .grf files with a GRFID of FFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== type ===&lt;br /&gt;
&lt;br /&gt;
This sets the type of feature that the graphics are for. If bit 7 is set, the offset variable needs to be set. Bit 7 may only be set if the type supports it. The type can be one of:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Type!!Version!!Feature!!num-sprites (decimal)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal and semaphore graphics||112&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04,84&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Offset allowed since {{ottdp|1.2|no|ottdrev=r23005}}&amp;lt;/ref&amp;gt;||{{ottdp| |2.5|ttdprev=alpha 41}}||Pre-signal, semaphore, and PBS graphics||240&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05,85&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.0}}||Overhead wires and pylon graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06 ||{{ottdp|0.6| }}||Foundations (retaining walls) for BuildOnSlopes ||74&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06,86&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11321}}||Foundations for BuildOnSlopes and half tiles (NS and EW foundations) ||90&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|07||{{ottdp|no|2.5|ttdprev=alpha 43}}||TTDPatch GUI sprites||93 &amp;lt;ref&amp;gt;Type 07 only requires 73 sprites in the stable (2.5 branch); the extra sprites are the clone train and build canal cursors.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|08,88&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no}}&amp;lt;ref&amp;gt;TTDPatch supported canals via Action5 from 2.0.1 alpha 17 up to alpha 25. In alpha 26 it was removed again in favour of an action-1-2-3 method; see [[Action3/Canals|Action3]]. The method via Action5 is no longer supported by TTDpatch 2.0.1 alpha 26 and newer.&amp;lt;/ref&amp;gt;||Canals||65&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|09,89&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 58}}||One-way road arrows||{{ottdp|13|no}} 18 {{ottdp|0.6 - 12|2.5}} 6&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0A,8A&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 67}}||Two company color translation maps||256&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0B,8B&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 68}}||Tram tracks||{{ottdp|1.10|no}} 119 {{ottdp|0.6 - 1.9|2.5}} 113&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0C||{{ottdp|no|2.5|ttdprev=alpha 74}}||Snowy temperate trees||133&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0D||{{ottdp|0.6|2.5|ottdrev=r7325 (r11726)|ttdprev=beta 5}}||Coast Tile graphics||16 (18)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0E||{{ottdp|no|2.6|ttdprev=r1247}}||New Signals||Any&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0F,8F&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13469|ttdprev=r1487}}||Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP)||Up to 12&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|10,90&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r9645}}||Additional airport graphics||15&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|11,91&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.6|ottdrev=r9645|ttdprev=r1589}}||Road stop graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12,92&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13464|ttdprev=r1498}}||Aqueduct graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|13,93&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11433}}||Autorail sprites||55&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|14,94||{{ottdp|0.6 - 1.11|no|ottdrev=11433}}||Flag sprites (no longer used)||Up to 36&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|15,95||{{ottdp|0.6|no|ottdrev=r11433}}||OpenTTD GUI sprites||Up to 191&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|16,96||{{ottdp|1.1|no|ottdrev=r20370}}||Airport preview sprites||Up to 9&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|17,97||{{ottdp|1.2|no|ottdrev=r23952}}||Railtype tunnel base sprites||16&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|18,98||{{ottdp|1.5|no|ottdrev=r26869}}||Extra all black palette||1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 04 Signal graphics. ====&lt;br /&gt;
&lt;br /&gt;
Signal graphics come in groups of 16. These groups contain sprites in the same order as sprites 1275-1290 in trg1[r].grf; red, then green, for each of: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Group(s)!!Contents&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0||lighted entrance signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|1||lighted exit signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|2||lighted combo signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3||standard (non-pre-signal) semaphore signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4..6||repeat 0..2 for semaphores&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|7||standard lighted PBS signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|8..14||repeat 0..6 for PBS signals&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 09 One-way road arrows ====&lt;br /&gt;
&lt;br /&gt;
Overlay sprites to indicate the direction of one-way roads.&lt;br /&gt;
The 6 sprites originally supported from {{ottdp|0.6|2.5}} are, in order:&lt;br /&gt;
&lt;br /&gt;
 arrow facing SW, arrow NE, impassable NE-SW, arrow NW, arrow SE, impassable NW-SE.&lt;br /&gt;
&lt;br /&gt;
Before {{ottdp|13|no}} these are used on both flat and sloped roads. From {{ottdp|13|no}} an additional 12 sprites are supported. These are the above sequence repeated for slopes with the N corner raised, and again for slopes with the S corner raised. If an Action 5 provides only the first 6 sprites these will be used on slopes as before.&lt;br /&gt;
&lt;br /&gt;
==== 0C Snowy temperate trees ====&lt;br /&gt;
&lt;br /&gt;
If the temperate snow line is enabled, you can use this to specify the snowy versions of temperate trees. The sprites must be the snowy versions of sprites 1576-1708 from TRG1.GRF, in the same order as they appear there.&lt;br /&gt;
&lt;br /&gt;
==== 0D Coast tile sprites ====&lt;br /&gt;
&lt;br /&gt;
===== In NewGRFs =====&lt;br /&gt;
If diagonal flooding is enabled then due to new corner coasts, you can use this to give a complete set of replacement coast tile sprites. There are 16 in total, 8 original Transport Tycoon Deluxe sprites and 8 for the corner slopes. Order of the sprites&amp;lt;ref name=numbers&amp;gt;Sprite numbers from trg1(r).pcx.&amp;lt;/ref&amp;gt; is as follows:&lt;br /&gt;
&lt;br /&gt;
 3997, 4063, 4064, 4068, 4062, 3998, 4066, 3988,&lt;br /&gt;
 4065, 4069, 3996, 3992, 4067, 3994, 3995, 3999.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast16Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The 16 sprites for feature 0D&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== In Base Set&#039;s extra grf =====&lt;br /&gt;
Additionally, OpenTTD (since r11726) supports another method of supplying all additional coast tile sprites, but this is only allowed in the &#039;&#039;extra&#039;&#039; NewGRF of [http://wiki.openttd.org/Base_graphics Base Graphic Sets]. In this, only 10 sprites are supplied in the same order as the 16 sprites above, but without the coast sprites already in the base grf. Note that the 10 sprites version supplies two additional slopes, but they are not used, and are currently unlikely to be ever used.&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast10Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Only 10 sprites are required for OpenTTD base graphic sets&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In OpenTTD 10 sprites for type 0D is enough in base graphic sets. The 16 sprites version should not be used for base graphics.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason for the existence of a 10 sprite version is to remove the need for including original graphics, and to keep compatibility with old NewGRFs that replace the original shore graphics using Action A without adding new shores using Action 5: When a NewGRF uses the 16 sprites version it takes precedence above any NewGRF replacing the shore graphics using Action A; when a NewGRF uses Action A to replace shore graphics it takes precedence above a 10-sprite Action 5, effectively disabling diagonal flooding. Also due to compatibility the 10 sprites version is invalid for normal NewGRFs, which are not the &amp;quot;extra&amp;quot; NewGRF of some Base Graphics Set.&lt;br /&gt;
&lt;br /&gt;
==== 0E New Signals ====&lt;br /&gt;
&lt;br /&gt;
Any number of real and recolour sprites can be specified in the action in any order.&lt;br /&gt;
&lt;br /&gt;
Sprites are referenced by their offset into the action5 block by a [[VarAction2NewSignals]], hence a logically easily calculable order is advised.&lt;br /&gt;
&lt;br /&gt;
As of TTDPatch 2.6 alpha 0 r1346, the action 5 block defined in the same GRF file as the varaction2, will be used as the base sprite block for the offsets returned by the callback even if it is overridden by a higher priority GRF action 5 definition of the same feature (0E).&lt;br /&gt;
&lt;br /&gt;
==== 0F Tracks for Slopes ====&lt;br /&gt;
&lt;br /&gt;
This should be in the same order as sprites 1031 to 1035 (1). These should only be the rails, basically the same format as sprites 1005 to 1010 (1). There should be 3 groups of these sprites, one for each rail type (railroad, monorail, maglev).&lt;br /&gt;
&lt;br /&gt;
(1) Sprite numbers from trg1r.pcx / ogfx1_base.grf&lt;br /&gt;
&lt;br /&gt;
==== 11 Road stop graphics ====&lt;br /&gt;
&lt;br /&gt;
Road stop graphics consist of 2 groups of 4 sprites. The first group contains graphics for bus stops, second for truck stops. In each group, the sprites are in the following order: SW, NE, NW, SE.&lt;br /&gt;
&lt;br /&gt;
SW and NE sprites are used with road going along the Y axis ( .\&#039; ), NW and SE with road along the X axis( &#039;/. ).&lt;br /&gt;
&lt;br /&gt;
Internally, the stations are defined using the following station layouts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1313&lt;br /&gt;
&lt;br /&gt;
\b13 \b0 \b0 \b3 \b16 \b16 &amp;lt;SW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b3 \b16 \b16 &amp;lt;NE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1314&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b16 \b3 \b16 &amp;lt;NW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b13 \b0 \b16 \b3 \b16 &amp;lt;SE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where 1313 and 1314 are town road sprites.&lt;br /&gt;
&lt;br /&gt;
[[File:roadstops.png]]&lt;br /&gt;
&lt;br /&gt;
Further sprites can be found in &#039;&#039;&#039;openttd.grf&#039;&#039;&#039; (OpenTTD), &#039;&#039;&#039;ogfxe_extra.grf&#039;&#039;&#039; (OpenGFX) or &#039;&#039;&#039;ttdpbase(w).grf&#039;&#039;&#039; (TTDPatch).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As of OpenTTD r10185, the behaviour of this feature is identical in both games.&lt;br /&gt;
&lt;br /&gt;
==== 12 Aqueducts ====&lt;br /&gt;
&lt;br /&gt;
8 real sprites should be given. Firstly: 4 bridge end sprites in the order: SW, SE, NE, NW, where the direction is that heading onto the aqueduct. Then 2 middle part sprites for the X and Y directions. Followed by two pillar sprites for the X and Y directions. For examples of where the division between middle sprites and pillars should be made see sprites 2437 to 2592 (1), or an existing aqueduct GRF. Note, that for higher bridges to work effectively, pillars should be approximately 8px in height.&lt;br /&gt;
&lt;br /&gt;
[[File:aqueduct.png]]&lt;br /&gt;
&lt;br /&gt;
==== 15 / 95 OpenTTD GUI sprites ====&lt;br /&gt;
&lt;br /&gt;
OpenTTD defines 190 GUI sprites. Additional sprites not needed by an OpenTTD are simply ignored, so that new(er) base sets can be used by old OpenTTD versions. One can (re-)define a subset of the GUI sprites by giving an offset into the GUI sprites. The sprites are:&lt;br /&gt;
{|&lt;br /&gt;
!Offset !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0 .. 11|| Halftile selections&lt;br /&gt;
|-&lt;br /&gt;
|12 .. 13 || Title screen letters E and D&lt;br /&gt;
|-&lt;br /&gt;
|14 .. 37 || Bridge piers colours 1 .. 4&lt;br /&gt;
|-&lt;br /&gt;
|38 || square indicating NewGRF compatibility&lt;br /&gt;
|-&lt;br /&gt;
|39 || blob indicating server compatibility&lt;br /&gt;
|-&lt;br /&gt;
|40 || lock icon&lt;br /&gt;
|-&lt;br /&gt;
|41 || empty check box&lt;br /&gt;
|-&lt;br /&gt;
|42 || checked check box&lt;br /&gt;
|-&lt;br /&gt;
|43 || warning sign&lt;br /&gt;
|-&lt;br /&gt;
|44 || window resize right&lt;br /&gt;
|-&lt;br /&gt;
|45 .. 48|| arrows&lt;br /&gt;
|-&lt;br /&gt;
|49 || house&lt;br /&gt;
|-&lt;br /&gt;
|50 || shared orders&lt;br /&gt;
|-&lt;br /&gt;
|51 .. 52 || pin / pinned&lt;br /&gt;
|-&lt;br /&gt;
|53 .. 62 || rail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|63 .. 68 || monorail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|69 .. 74 || maglev build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|75 || ??&lt;br /&gt;
|-&lt;br /&gt;
|76 .. 77 || waypoint toolbar and cursor icon&lt;br /&gt;
|-&lt;br /&gt;
|78 .. 81 || waypoint buildings&lt;br /&gt;
|-&lt;br /&gt;
|82 .. 85 || autoroad toobar and cursor for road and trams&lt;br /&gt;
|-&lt;br /&gt;
|86 || helipad&lt;br /&gt;
|-&lt;br /&gt;
|87 || build ship lift cursor&lt;br /&gt;
|-&lt;br /&gt;
|88 .. 89 || build canal toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|90 || fast forward&lt;br /&gt;
|-&lt;br /&gt;
|91 .. 92 || level land toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|93 .. 96 || sell vehicle&lt;br /&gt;
|-&lt;br /&gt;
|97 .. 100 || sell all vehicles&lt;br /&gt;
|-&lt;br /&gt;
|101 .. 104 || replace vehicle&lt;br /&gt;
|-&lt;br /&gt;
|105 || sell chain of rail vehicles&lt;br /&gt;
|-&lt;br /&gt;
|106 .. 113 || clone vehicles button and cursors&lt;br /&gt;
|-&lt;br /&gt;
|114 .. 117 || create vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|118 .. 121 || delete vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|122 .. 125 || rename vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|126 .. 133 || group replace on / off button&lt;br /&gt;
|-&lt;br /&gt;
|134 || road toolbar: build one-way roads&lt;br /&gt;
|-&lt;br /&gt;
|135 || signal toolbar: convert signals&lt;br /&gt;
|-&lt;br /&gt;
|136 .. 137|| build rivers toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|138 .. 143 || OSK&lt;br /&gt;
|-&lt;br /&gt;
|144 || switch toolbar&lt;br /&gt;
|-&lt;br /&gt;
|145 .. 146 || build aqueduct toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|147 .. 148 || (+) and (-) icon&lt;br /&gt;
|-&lt;br /&gt;
|149 || window resize left&lt;br /&gt;
|-&lt;br /&gt;
|150 || play music right-to-left languages&lt;br /&gt;
|-&lt;br /&gt;
|151 .. 152 || shade / unshade&lt;br /&gt;
|-&lt;br /&gt;
|153 || debug&lt;br /&gt;
|-&lt;br /&gt;
|154 .. 157 || vehicle profit icons&lt;br /&gt;
|-&lt;br /&gt;
|158 || unread news&lt;br /&gt;
|-&lt;br /&gt;
|159 || exclusive transport rights&lt;br /&gt;
|-&lt;br /&gt;
|160 || autoreplace protection&lt;br /&gt;
|-&lt;br /&gt;
|161 || autoreplace defined&lt;br /&gt;
|-&lt;br /&gt;
|162 .. 165 || Town happiness indicator: N/A, appalling, mediocre and good&lt;br /&gt;
|-&lt;br /&gt;
|166 .. 167 || Icons for delete to the left resp. right&lt;br /&gt;
|-&lt;br /&gt;
|168 || Default window size&lt;br /&gt;
|-&lt;br /&gt;
|169 .. 173 || Story book: Main toolbar icon, goto place, unfinished goal, finished goal, broken goal&lt;br /&gt;
|-&lt;br /&gt;
|174 || Smallmap cargoflow button&lt;br /&gt;
|-&lt;br /&gt;
|175 .. 178 || Icons for group livery selection&lt;br /&gt;
|-&lt;br /&gt;
|179 .. 183 || NotRoadTypes toolbar and cursor icons&lt;br /&gt;
|-&lt;br /&gt;
|184 || {{ottd|1.11|g8dda0ec4f}} window title bar: rename vehicle/station/town/...&lt;br /&gt;
|-&lt;br /&gt;
|185 || {{ottd|1.11|g8dda0ec4f}} window title bar: go to location of vehicle/station/town/industry/...&lt;br /&gt;
|-&lt;br /&gt;
|186 .. 190 || {{ottd|1.12|gfda1a590f6}} multiplayer GUI: chat, admin action, join team, self player, host player&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 16 / 96 Airport preview sprites ====&lt;br /&gt;
[[File:airport_preview_commuter.png|right]]&lt;br /&gt;
Preview sprites for the airports in the order&lt;br /&gt;
# Small airport&lt;br /&gt;
# City airport&lt;br /&gt;
# Heliport&lt;br /&gt;
# Metropolitan airport&lt;br /&gt;
# International airport&lt;br /&gt;
# Commuter airport&lt;br /&gt;
# Heli depot&lt;br /&gt;
# Intercontinental airport&lt;br /&gt;
# Heli station&lt;br /&gt;
&lt;br /&gt;
Sprites are without any offsets and should all be the same size. Make sure so by using the forbid cropping.&lt;br /&gt;
&lt;br /&gt;
==== 17 / 97 Tunnel overlay sprites ====&lt;br /&gt;
[[File:tunnel_overlays.png|right]]&lt;br /&gt;
The sprites provide the ground for the tunnel sprites to be used by railtype NewGRFs which only need to provide the tunnel portals. They must be provided for both terrain types which could be used in any given climate (grass; grass+snow; grass+desert; grass).&lt;br /&gt;
&lt;br /&gt;
=== num-sprites ===&lt;br /&gt;
&lt;br /&gt;
The number of sprites that follow.&lt;br /&gt;
&lt;br /&gt;
Since TTDPatch 2.0.1 alpha 49, this value is an extended byte.&lt;br /&gt;
&lt;br /&gt;
Note that it is not generally an error to provide more sprites than required, but this does expend sprite slots unnecessarily.&lt;br /&gt;
&lt;br /&gt;
=== offset ===&lt;br /&gt;
&lt;br /&gt;
The offset in the Action 5 assignable block of sprites. This term is only read when bit 7 of the type has been set. It can be used to only replace a subset of sprites from a set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When creating a TTDPatch compatible grf, you have to skip the OpenTTD specific Action 05&#039;s using an Action 09 rather than an Action 07. Using the latter will result in an error on your Action 05 when using the grf in TTDPatch.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; NFORenum distinguishes Action5 with no offset and Action5 with offset 0. While they have technically the same effect, NFORenum assumes an Action5 with no offset has the intention to replace all sprites and checks the number of sprites accordingly. An Action5 with offset is considered to only replace a subset of the sprites, so the sprites are not checked for completeness.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Replace the piers for the aqueduct&lt;br /&gt;
 1457 * 3        05 12 02 06 // action5, type 12, 2 sprites, at offset 6 into that type&lt;br /&gt;
    9 sprites/png/terrain/waterfeatures.png 546 8 09 23 33 -26 0&lt;br /&gt;
   10 sprites/png/terrain/waterfeatures.png 594 8 09 23 33 -5 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4331</id>
		<title>Action5</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4331"/>
		<updated>2022-12-26T20:39:45Z</updated>

		<summary type="html">&lt;p&gt;Flherne: /* type */ There is no version 1.13&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define base graphics specific sets&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Action 5 is used to define graphics for several new features of OpenTTD and TTDPatch. This is similar to action 1.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 05 &amp;lt;type&amp;gt; &amp;lt;num-sprites&amp;gt; [&amp;lt;offset&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Sprite-number&amp;gt;||dec||A sequential sprite number&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;||dec||The total number of bytes used in this action&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05||B||Defines action 05&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;type&amp;gt;||B||What type of graphics follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;num-sprites&amp;gt;||B*||How many regular sprites follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;offset&amp;gt;||B*||Offset in the Action 5 assignable block of sprites&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following num-sprites sprites in the .nfo file have to be RealSprites that will be used as graphics for the given TTDPatch feature, except for type 0A, which requires RecolorSprites.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|2.5|ttdprev=alpha 19}}Action 5 entries in a .grf file which has a regular GRFID (not FFFFFFFF) will always override those from .grf files with a GRFID of FFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== type ===&lt;br /&gt;
&lt;br /&gt;
This sets the type of feature that the graphics are for. If bit 7 is set, the offset variable needs to be set. Bit 7 may only be set if the type supports it. The type can be one of:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Type!!Version!!Feature!!num-sprites (decimal)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal and semaphore graphics||112&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04,84&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Offset allowed since {{ottdp|1.2|no|ottdrev=r23005}}&amp;lt;/ref&amp;gt;||{{ottdp| |2.5|ttdprev=alpha 41}}||Pre-signal, semaphore, and PBS graphics||240&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05,85&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.0}}||Overhead wires and pylon graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06 ||{{ottdp|0.6| }}||Foundations (retaining walls) for BuildOnSlopes ||74&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06,86&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11321}}||Foundations for BuildOnSlopes and half tiles (NS and EW foundations) ||90&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|07||{{ottdp|no|2.5|ttdprev=alpha 43}}||TTDPatch GUI sprites||93 &amp;lt;ref&amp;gt;Type 07 only requires 73 sprites in the stable (2.5 branch); the extra sprites are the clone train and build canal cursors.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|08,88&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no}}&amp;lt;ref&amp;gt;TTDPatch supported canals via Action5 from 2.0.1 alpha 17 up to alpha 25. In alpha 26 it was removed again in favour of an action-1-2-3 method; see [[Action3/Canals|Action3]]. The method via Action5 is no longer supported by TTDpatch 2.0.1 alpha 26 and newer.&amp;lt;/ref&amp;gt;||Canals||65&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|09,89&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 58}}||One-way road arrows||{{ottdp|13|no}} 18 {{ottdp|0.6 - 12|2.5}} 6&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0A,8A&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 67}}||Two company color translation maps||256&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0B,8B&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 68}}||Tram tracks||{{ottdp|1.10|no}} 119 {{ottdp|0.6 - 1.9|2.5}} 113&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0C||{{ottdp|no|2.5|ttdprev=alpha 74}}||Snowy temperate trees||133&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0D||{{ottdp|0.6|2.5|ottdrev=r7325 (r11726)|ttdprev=beta 5}}||Coast Tile graphics||16 (18)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0E||{{ottdp|no|2.6|ttdprev=r1247}}||New Signals||Any&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0F,8F&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13469|ttdprev=r1487}}||Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP)||Up to 12&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|10,90&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r9645}}||Additional airport graphics||15&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|11,91&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.6|ottdrev=r9645|ttdprev=r1589}}||Road stop graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12,92&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13464|ttdprev=r1498}}||Aqueduct graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|13,93&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11433}}||Autorail sprites||55&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|14,94||{{ottdp|0.6 - 1.11|no|ottdrev=11433}}||Flag sprites (no longer used)||Up to 36&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|15,95||{{ottdp|0.6|no|ottdrev=r11433}}||OpenTTD GUI sprites||Up to 191&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|16,96||{{ottdp|1.1|no|ottdrev=r20370}}||Airport preview sprites||Up to 9&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|17,97||{{ottdp|1.2|no|ottdrev=r23952}}||Railtype tunnel base sprites||16&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|18,98||{{ottdp|1.5|no|ottdrev=r26869}}||Extra all black palette||1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 04 Signal graphics. ====&lt;br /&gt;
&lt;br /&gt;
Signal graphics come in groups of 16. These groups contain sprites in the same order as sprites 1275-1290 in trg1[r].grf; red, then green, for each of: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Group(s)!!Contents&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0||lighted entrance signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|1||lighted exit signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|2||lighted combo signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3||standard (non-pre-signal) semaphore signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4..6||repeat 0..2 for semaphores&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|7||standard lighted PBS signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|8..14||repeat 0..6 for PBS signals&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 0C Snowy temperate trees ====&lt;br /&gt;
&lt;br /&gt;
If the temperate snow line is enabled, you can use this to specify the snowy versions of temperate trees. The sprites must be the snowy versions of sprites 1576-1708 from TRG1.GRF, in the same order as they appear there.&lt;br /&gt;
&lt;br /&gt;
==== 0D Coast tile sprites ====&lt;br /&gt;
&lt;br /&gt;
===== In NewGRFs =====&lt;br /&gt;
If diagonal flooding is enabled then due to new corner coasts, you can use this to give a complete set of replacement coast tile sprites. There are 16 in total, 8 original Transport Tycoon Deluxe sprites and 8 for the corner slopes. Order of the sprites&amp;lt;ref name=numbers&amp;gt;Sprite numbers from trg1(r).pcx.&amp;lt;/ref&amp;gt; is as follows:&lt;br /&gt;
&lt;br /&gt;
 3997, 4063, 4064, 4068, 4062, 3998, 4066, 3988,&lt;br /&gt;
 4065, 4069, 3996, 3992, 4067, 3994, 3995, 3999.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast16Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The 16 sprites for feature 0D&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== In Base Set&#039;s extra grf =====&lt;br /&gt;
Additionally, OpenTTD (since r11726) supports another method of supplying all additional coast tile sprites, but this is only allowed in the &#039;&#039;extra&#039;&#039; NewGRF of [http://wiki.openttd.org/Base_graphics Base Graphic Sets]. In this, only 10 sprites are supplied in the same order as the 16 sprites above, but without the coast sprites already in the base grf. Note that the 10 sprites version supplies two additional slopes, but they are not used, and are currently unlikely to be ever used.&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast10Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Only 10 sprites are required for OpenTTD base graphic sets&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In OpenTTD 10 sprites for type 0D is enough in base graphic sets. The 16 sprites version should not be used for base graphics.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason for the existence of a 10 sprite version is to remove the need for including original graphics, and to keep compatibility with old NewGRFs that replace the original shore graphics using Action A without adding new shores using Action 5: When a NewGRF uses the 16 sprites version it takes precedence above any NewGRF replacing the shore graphics using Action A; when a NewGRF uses Action A to replace shore graphics it takes precedence above a 10-sprite Action 5, effectively disabling diagonal flooding. Also due to compatibility the 10 sprites version is invalid for normal NewGRFs, which are not the &amp;quot;extra&amp;quot; NewGRF of some Base Graphics Set.&lt;br /&gt;
&lt;br /&gt;
==== 0E New Signals ====&lt;br /&gt;
&lt;br /&gt;
Any number of real and recolour sprites can be specified in the action in any order.&lt;br /&gt;
&lt;br /&gt;
Sprites are referenced by their offset into the action5 block by a [[VarAction2NewSignals]], hence a logically easily calculable order is advised.&lt;br /&gt;
&lt;br /&gt;
As of TTDPatch 2.6 alpha 0 r1346, the action 5 block defined in the same GRF file as the varaction2, will be used as the base sprite block for the offsets returned by the callback even if it is overridden by a higher priority GRF action 5 definition of the same feature (0E).&lt;br /&gt;
&lt;br /&gt;
==== 0F Tracks for Slopes ====&lt;br /&gt;
&lt;br /&gt;
This should be in the same order as sprites 1031 to 1035 (1). These should only be the rails, basically the same format as sprites 1005 to 1010 (1). There should be 3 groups of these sprites, one for each rail type (railroad, monorail, maglev).&lt;br /&gt;
&lt;br /&gt;
(1) Sprite numbers from trg1r.pcx / ogfx1_base.grf&lt;br /&gt;
&lt;br /&gt;
==== 11 Road stop graphics ====&lt;br /&gt;
&lt;br /&gt;
Road stop graphics consist of 2 groups of 4 sprites. The first group contains graphics for bus stops, second for truck stops. In each group, the sprites are in the following order: SW, NE, NW, SE.&lt;br /&gt;
&lt;br /&gt;
SW and NE sprites are used with road going along the Y axis ( .\&#039; ), NW and SE with road along the X axis( &#039;/. ).&lt;br /&gt;
&lt;br /&gt;
Internally, the stations are defined using the following station layouts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1313&lt;br /&gt;
&lt;br /&gt;
\b13 \b0 \b0 \b3 \b16 \b16 &amp;lt;SW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b3 \b16 \b16 &amp;lt;NE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1314&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b16 \b3 \b16 &amp;lt;NW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b13 \b0 \b16 \b3 \b16 &amp;lt;SE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where 1313 and 1314 are town road sprites.&lt;br /&gt;
&lt;br /&gt;
[[File:roadstops.png]]&lt;br /&gt;
&lt;br /&gt;
Further sprites can be found in &#039;&#039;&#039;openttd.grf&#039;&#039;&#039; (OpenTTD), &#039;&#039;&#039;ogfxe_extra.grf&#039;&#039;&#039; (OpenGFX) or &#039;&#039;&#039;ttdpbase(w).grf&#039;&#039;&#039; (TTDPatch).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As of OpenTTD r10185, the behaviour of this feature is identical in both games.&lt;br /&gt;
&lt;br /&gt;
==== 12 Aqueducts ====&lt;br /&gt;
&lt;br /&gt;
8 real sprites should be given. Firstly: 4 bridge end sprites in the order: SW, SE, NE, NW, where the direction is that heading onto the aqueduct. Then 2 middle part sprites for the X and Y directions. Followed by two pillar sprites for the X and Y directions. For examples of where the division between middle sprites and pillars should be made see sprites 2437 to 2592 (1), or an existing aqueduct GRF. Note, that for higher bridges to work effectively, pillars should be approximately 8px in height.&lt;br /&gt;
&lt;br /&gt;
[[File:aqueduct.png]]&lt;br /&gt;
&lt;br /&gt;
==== 15 / 95 OpenTTD GUI sprites ====&lt;br /&gt;
&lt;br /&gt;
OpenTTD defines 190 GUI sprites. Additional sprites not needed by an OpenTTD are simply ignored, so that new(er) base sets can be used by old OpenTTD versions. One can (re-)define a subset of the GUI sprites by giving an offset into the GUI sprites. The sprites are:&lt;br /&gt;
{|&lt;br /&gt;
!Offset !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0 .. 11|| Halftile selections&lt;br /&gt;
|-&lt;br /&gt;
|12 .. 13 || Title screen letters E and D&lt;br /&gt;
|-&lt;br /&gt;
|14 .. 37 || Bridge piers colours 1 .. 4&lt;br /&gt;
|-&lt;br /&gt;
|38 || square indicating NewGRF compatibility&lt;br /&gt;
|-&lt;br /&gt;
|39 || blob indicating server compatibility&lt;br /&gt;
|-&lt;br /&gt;
|40 || lock icon&lt;br /&gt;
|-&lt;br /&gt;
|41 || empty check box&lt;br /&gt;
|-&lt;br /&gt;
|42 || checked check box&lt;br /&gt;
|-&lt;br /&gt;
|43 || warning sign&lt;br /&gt;
|-&lt;br /&gt;
|44 || window resize right&lt;br /&gt;
|-&lt;br /&gt;
|45 .. 48|| arrows&lt;br /&gt;
|-&lt;br /&gt;
|49 || house&lt;br /&gt;
|-&lt;br /&gt;
|50 || shared orders&lt;br /&gt;
|-&lt;br /&gt;
|51 .. 52 || pin / pinned&lt;br /&gt;
|-&lt;br /&gt;
|53 .. 62 || rail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|63 .. 68 || monorail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|69 .. 74 || maglev build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|75 || ??&lt;br /&gt;
|-&lt;br /&gt;
|76 .. 77 || waypoint toolbar and cursor icon&lt;br /&gt;
|-&lt;br /&gt;
|78 .. 81 || waypoint buildings&lt;br /&gt;
|-&lt;br /&gt;
|82 .. 85 || autoroad toobar and cursor for road and trams&lt;br /&gt;
|-&lt;br /&gt;
|86 || helipad&lt;br /&gt;
|-&lt;br /&gt;
|87 || build ship lift cursor&lt;br /&gt;
|-&lt;br /&gt;
|88 .. 89 || build canal toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|90 || fast forward&lt;br /&gt;
|-&lt;br /&gt;
|91 .. 92 || level land toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|93 .. 96 || sell vehicle&lt;br /&gt;
|-&lt;br /&gt;
|97 .. 100 || sell all vehicles&lt;br /&gt;
|-&lt;br /&gt;
|101 .. 104 || replace vehicle&lt;br /&gt;
|-&lt;br /&gt;
|105 || sell chain of rail vehicles&lt;br /&gt;
|-&lt;br /&gt;
|106 .. 113 || clone vehicles button and cursors&lt;br /&gt;
|-&lt;br /&gt;
|114 .. 117 || create vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|118 .. 121 || delete vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|122 .. 125 || rename vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|126 .. 133 || group replace on / off button&lt;br /&gt;
|-&lt;br /&gt;
|134 || road toolbar: build one-way roads&lt;br /&gt;
|-&lt;br /&gt;
|135 || signal toolbar: convert signals&lt;br /&gt;
|-&lt;br /&gt;
|136 .. 137|| build rivers toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|138 .. 143 || OSK&lt;br /&gt;
|-&lt;br /&gt;
|144 || switch toolbar&lt;br /&gt;
|-&lt;br /&gt;
|145 .. 146 || build aqueduct toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|147 .. 148 || (+) and (-) icon&lt;br /&gt;
|-&lt;br /&gt;
|149 || window resize left&lt;br /&gt;
|-&lt;br /&gt;
|150 || play music right-to-left languages&lt;br /&gt;
|-&lt;br /&gt;
|151 .. 152 || shade / unshade&lt;br /&gt;
|-&lt;br /&gt;
|153 || debug&lt;br /&gt;
|-&lt;br /&gt;
|154 .. 157 || vehicle profit icons&lt;br /&gt;
|-&lt;br /&gt;
|158 || unread news&lt;br /&gt;
|-&lt;br /&gt;
|159 || exclusive transport rights&lt;br /&gt;
|-&lt;br /&gt;
|160 || autoreplace protection&lt;br /&gt;
|-&lt;br /&gt;
|161 || autoreplace defined&lt;br /&gt;
|-&lt;br /&gt;
|162 .. 165 || Town happiness indicator: N/A, appalling, mediocre and good&lt;br /&gt;
|-&lt;br /&gt;
|166 .. 167 || Icons for delete to the left resp. right&lt;br /&gt;
|-&lt;br /&gt;
|168 || Default window size&lt;br /&gt;
|-&lt;br /&gt;
|169 .. 173 || Story book: Main toolbar icon, goto place, unfinished goal, finished goal, broken goal&lt;br /&gt;
|-&lt;br /&gt;
|174 || Smallmap cargoflow button&lt;br /&gt;
|-&lt;br /&gt;
|175 .. 178 || Icons for group livery selection&lt;br /&gt;
|-&lt;br /&gt;
|179 .. 183 || NotRoadTypes toolbar and cursor icons&lt;br /&gt;
|-&lt;br /&gt;
|184 || {{ottd|1.11|g8dda0ec4f}} window title bar: rename vehicle/station/town/...&lt;br /&gt;
|-&lt;br /&gt;
|185 || {{ottd|1.11|g8dda0ec4f}} window title bar: go to location of vehicle/station/town/industry/...&lt;br /&gt;
|-&lt;br /&gt;
|186 .. 190 || {{ottd|1.12|gfda1a590f6}} multiplayer GUI: chat, admin action, join team, self player, host player&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 16 / 96 Airport preview sprites ====&lt;br /&gt;
[[File:airport_preview_commuter.png|right]]&lt;br /&gt;
Preview sprites for the airports in the order&lt;br /&gt;
# Small airport&lt;br /&gt;
# City airport&lt;br /&gt;
# Heliport&lt;br /&gt;
# Metropolitan airport&lt;br /&gt;
# International airport&lt;br /&gt;
# Commuter airport&lt;br /&gt;
# Heli depot&lt;br /&gt;
# Intercontinental airport&lt;br /&gt;
# Heli station&lt;br /&gt;
&lt;br /&gt;
Sprites are without any offsets and should all be the same size. Make sure so by using the forbid cropping.&lt;br /&gt;
&lt;br /&gt;
==== 17 / 97 Tunnel overlay sprites ====&lt;br /&gt;
[[File:tunnel_overlays.png|right]]&lt;br /&gt;
The sprites provide the ground for the tunnel sprites to be used by railtype NewGRFs which only need to provide the tunnel portals. They must be provided for both terrain types which could be used in any given climate (grass; grass+snow; grass+desert; grass).&lt;br /&gt;
&lt;br /&gt;
=== num-sprites ===&lt;br /&gt;
&lt;br /&gt;
The number of sprites that follow.&lt;br /&gt;
&lt;br /&gt;
Since TTDPatch 2.0.1 alpha 49, this value is an extended byte.&lt;br /&gt;
&lt;br /&gt;
Note that it is not generally an error to provide more sprites than required, but this does expend sprite slots unnecessarily.&lt;br /&gt;
&lt;br /&gt;
=== offset ===&lt;br /&gt;
&lt;br /&gt;
The offset in the Action 5 assignable block of sprites. This term is only read when bit 7 of the type has been set. It can be used to only replace a subset of sprites from a set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When creating a TTDPatch compatible grf, you have to skip the OpenTTD specific Action 05&#039;s using an Action 09 rather than an Action 07. Using the latter will result in an error on your Action 05 when using the grf in TTDPatch.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; NFORenum distinguishes Action5 with no offset and Action5 with offset 0. While they have technically the same effect, NFORenum assumes an Action5 with no offset has the intention to replace all sprites and checks the number of sprites accordingly. An Action5 with offset is considered to only replace a subset of the sprites, so the sprites are not checked for completeness.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Replace the piers for the aqueduct&lt;br /&gt;
 1457 * 3        05 12 02 06 // action5, type 12, 2 sprites, at offset 6 into that type&lt;br /&gt;
    9 sprites/png/terrain/waterfeatures.png 546 8 09 23 33 -26 0&lt;br /&gt;
   10 sprites/png/terrain/waterfeatures.png 594 8 09 23 33 -5 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4330</id>
		<title>Action5</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4330"/>
		<updated>2022-12-26T20:38:49Z</updated>

		<summary type="html">&lt;p&gt;Flherne: /* type */ Additional one-way road sprites&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define base graphics specific sets&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Action 5 is used to define graphics for several new features of OpenTTD and TTDPatch. This is similar to action 1.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 05 &amp;lt;type&amp;gt; &amp;lt;num-sprites&amp;gt; [&amp;lt;offset&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Sprite-number&amp;gt;||dec||A sequential sprite number&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;||dec||The total number of bytes used in this action&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05||B||Defines action 05&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;type&amp;gt;||B||What type of graphics follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;num-sprites&amp;gt;||B*||How many regular sprites follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;offset&amp;gt;||B*||Offset in the Action 5 assignable block of sprites&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following num-sprites sprites in the .nfo file have to be RealSprites that will be used as graphics for the given TTDPatch feature, except for type 0A, which requires RecolorSprites.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|2.5|ttdprev=alpha 19}}Action 5 entries in a .grf file which has a regular GRFID (not FFFFFFFF) will always override those from .grf files with a GRFID of FFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== type ===&lt;br /&gt;
&lt;br /&gt;
This sets the type of feature that the graphics are for. If bit 7 is set, the offset variable needs to be set. Bit 7 may only be set if the type supports it. The type can be one of:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Type!!Version!!Feature!!num-sprites (decimal)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal and semaphore graphics||112&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04,84&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Offset allowed since {{ottdp|1.2|no|ottdrev=r23005}}&amp;lt;/ref&amp;gt;||{{ottdp| |2.5|ttdprev=alpha 41}}||Pre-signal, semaphore, and PBS graphics||240&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05,85&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.0}}||Overhead wires and pylon graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06 ||{{ottdp|0.6| }}||Foundations (retaining walls) for BuildOnSlopes ||74&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06,86&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11321}}||Foundations for BuildOnSlopes and half tiles (NS and EW foundations) ||90&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|07||{{ottdp|no|2.5|ttdprev=alpha 43}}||TTDPatch GUI sprites||93 &amp;lt;ref&amp;gt;Type 07 only requires 73 sprites in the stable (2.5 branch); the extra sprites are the clone train and build canal cursors.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|08,88&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no}}&amp;lt;ref&amp;gt;TTDPatch supported canals via Action5 from 2.0.1 alpha 17 up to alpha 25. In alpha 26 it was removed again in favour of an action-1-2-3 method; see [[Action3/Canals|Action3]]. The method via Action5 is no longer supported by TTDpatch 2.0.1 alpha 26 and newer.&amp;lt;/ref&amp;gt;||Canals||65&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|09,89&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 58}}||One-way road arrows||{{ottdp|1.13|no}} 18 {{ottdp|0.6 - 12|2.5}} 6&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0A,8A&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 67}}||Two company color translation maps||256&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0B,8B&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 68}}||Tram tracks||{{ottdp|1.10|no}} 119 {{ottdp|0.6 - 1.9|2.5}} 113&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0C||{{ottdp|no|2.5|ttdprev=alpha 74}}||Snowy temperate trees||133&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0D||{{ottdp|0.6|2.5|ottdrev=r7325 (r11726)|ttdprev=beta 5}}||Coast Tile graphics||16 (18)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0E||{{ottdp|no|2.6|ttdprev=r1247}}||New Signals||Any&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0F,8F&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13469|ttdprev=r1487}}||Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP)||Up to 12&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|10,90&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r9645}}||Additional airport graphics||15&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|11,91&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.6|ottdrev=r9645|ttdprev=r1589}}||Road stop graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12,92&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13464|ttdprev=r1498}}||Aqueduct graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|13,93&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11433}}||Autorail sprites||55&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|14,94||{{ottdp|0.6 - 1.11|no|ottdrev=11433}}||Flag sprites (no longer used)||Up to 36&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|15,95||{{ottdp|0.6|no|ottdrev=r11433}}||OpenTTD GUI sprites||Up to 191&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|16,96||{{ottdp|1.1|no|ottdrev=r20370}}||Airport preview sprites||Up to 9&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|17,97||{{ottdp|1.2|no|ottdrev=r23952}}||Railtype tunnel base sprites||16&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|18,98||{{ottdp|1.5|no|ottdrev=r26869}}||Extra all black palette||1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 04 Signal graphics. ====&lt;br /&gt;
&lt;br /&gt;
Signal graphics come in groups of 16. These groups contain sprites in the same order as sprites 1275-1290 in trg1[r].grf; red, then green, for each of: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Group(s)!!Contents&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0||lighted entrance signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|1||lighted exit signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|2||lighted combo signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3||standard (non-pre-signal) semaphore signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4..6||repeat 0..2 for semaphores&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|7||standard lighted PBS signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|8..14||repeat 0..6 for PBS signals&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 0C Snowy temperate trees ====&lt;br /&gt;
&lt;br /&gt;
If the temperate snow line is enabled, you can use this to specify the snowy versions of temperate trees. The sprites must be the snowy versions of sprites 1576-1708 from TRG1.GRF, in the same order as they appear there.&lt;br /&gt;
&lt;br /&gt;
==== 0D Coast tile sprites ====&lt;br /&gt;
&lt;br /&gt;
===== In NewGRFs =====&lt;br /&gt;
If diagonal flooding is enabled then due to new corner coasts, you can use this to give a complete set of replacement coast tile sprites. There are 16 in total, 8 original Transport Tycoon Deluxe sprites and 8 for the corner slopes. Order of the sprites&amp;lt;ref name=numbers&amp;gt;Sprite numbers from trg1(r).pcx.&amp;lt;/ref&amp;gt; is as follows:&lt;br /&gt;
&lt;br /&gt;
 3997, 4063, 4064, 4068, 4062, 3998, 4066, 3988,&lt;br /&gt;
 4065, 4069, 3996, 3992, 4067, 3994, 3995, 3999.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast16Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The 16 sprites for feature 0D&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== In Base Set&#039;s extra grf =====&lt;br /&gt;
Additionally, OpenTTD (since r11726) supports another method of supplying all additional coast tile sprites, but this is only allowed in the &#039;&#039;extra&#039;&#039; NewGRF of [http://wiki.openttd.org/Base_graphics Base Graphic Sets]. In this, only 10 sprites are supplied in the same order as the 16 sprites above, but without the coast sprites already in the base grf. Note that the 10 sprites version supplies two additional slopes, but they are not used, and are currently unlikely to be ever used.&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast10Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Only 10 sprites are required for OpenTTD base graphic sets&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In OpenTTD 10 sprites for type 0D is enough in base graphic sets. The 16 sprites version should not be used for base graphics.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason for the existence of a 10 sprite version is to remove the need for including original graphics, and to keep compatibility with old NewGRFs that replace the original shore graphics using Action A without adding new shores using Action 5: When a NewGRF uses the 16 sprites version it takes precedence above any NewGRF replacing the shore graphics using Action A; when a NewGRF uses Action A to replace shore graphics it takes precedence above a 10-sprite Action 5, effectively disabling diagonal flooding. Also due to compatibility the 10 sprites version is invalid for normal NewGRFs, which are not the &amp;quot;extra&amp;quot; NewGRF of some Base Graphics Set.&lt;br /&gt;
&lt;br /&gt;
==== 0E New Signals ====&lt;br /&gt;
&lt;br /&gt;
Any number of real and recolour sprites can be specified in the action in any order.&lt;br /&gt;
&lt;br /&gt;
Sprites are referenced by their offset into the action5 block by a [[VarAction2NewSignals]], hence a logically easily calculable order is advised.&lt;br /&gt;
&lt;br /&gt;
As of TTDPatch 2.6 alpha 0 r1346, the action 5 block defined in the same GRF file as the varaction2, will be used as the base sprite block for the offsets returned by the callback even if it is overridden by a higher priority GRF action 5 definition of the same feature (0E).&lt;br /&gt;
&lt;br /&gt;
==== 0F Tracks for Slopes ====&lt;br /&gt;
&lt;br /&gt;
This should be in the same order as sprites 1031 to 1035 (1). These should only be the rails, basically the same format as sprites 1005 to 1010 (1). There should be 3 groups of these sprites, one for each rail type (railroad, monorail, maglev).&lt;br /&gt;
&lt;br /&gt;
(1) Sprite numbers from trg1r.pcx / ogfx1_base.grf&lt;br /&gt;
&lt;br /&gt;
==== 11 Road stop graphics ====&lt;br /&gt;
&lt;br /&gt;
Road stop graphics consist of 2 groups of 4 sprites. The first group contains graphics for bus stops, second for truck stops. In each group, the sprites are in the following order: SW, NE, NW, SE.&lt;br /&gt;
&lt;br /&gt;
SW and NE sprites are used with road going along the Y axis ( .\&#039; ), NW and SE with road along the X axis( &#039;/. ).&lt;br /&gt;
&lt;br /&gt;
Internally, the stations are defined using the following station layouts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1313&lt;br /&gt;
&lt;br /&gt;
\b13 \b0 \b0 \b3 \b16 \b16 &amp;lt;SW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b3 \b16 \b16 &amp;lt;NE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1314&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b16 \b3 \b16 &amp;lt;NW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b13 \b0 \b16 \b3 \b16 &amp;lt;SE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where 1313 and 1314 are town road sprites.&lt;br /&gt;
&lt;br /&gt;
[[File:roadstops.png]]&lt;br /&gt;
&lt;br /&gt;
Further sprites can be found in &#039;&#039;&#039;openttd.grf&#039;&#039;&#039; (OpenTTD), &#039;&#039;&#039;ogfxe_extra.grf&#039;&#039;&#039; (OpenGFX) or &#039;&#039;&#039;ttdpbase(w).grf&#039;&#039;&#039; (TTDPatch).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As of OpenTTD r10185, the behaviour of this feature is identical in both games.&lt;br /&gt;
&lt;br /&gt;
==== 12 Aqueducts ====&lt;br /&gt;
&lt;br /&gt;
8 real sprites should be given. Firstly: 4 bridge end sprites in the order: SW, SE, NE, NW, where the direction is that heading onto the aqueduct. Then 2 middle part sprites for the X and Y directions. Followed by two pillar sprites for the X and Y directions. For examples of where the division between middle sprites and pillars should be made see sprites 2437 to 2592 (1), or an existing aqueduct GRF. Note, that for higher bridges to work effectively, pillars should be approximately 8px in height.&lt;br /&gt;
&lt;br /&gt;
[[File:aqueduct.png]]&lt;br /&gt;
&lt;br /&gt;
==== 15 / 95 OpenTTD GUI sprites ====&lt;br /&gt;
&lt;br /&gt;
OpenTTD defines 190 GUI sprites. Additional sprites not needed by an OpenTTD are simply ignored, so that new(er) base sets can be used by old OpenTTD versions. One can (re-)define a subset of the GUI sprites by giving an offset into the GUI sprites. The sprites are:&lt;br /&gt;
{|&lt;br /&gt;
!Offset !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0 .. 11|| Halftile selections&lt;br /&gt;
|-&lt;br /&gt;
|12 .. 13 || Title screen letters E and D&lt;br /&gt;
|-&lt;br /&gt;
|14 .. 37 || Bridge piers colours 1 .. 4&lt;br /&gt;
|-&lt;br /&gt;
|38 || square indicating NewGRF compatibility&lt;br /&gt;
|-&lt;br /&gt;
|39 || blob indicating server compatibility&lt;br /&gt;
|-&lt;br /&gt;
|40 || lock icon&lt;br /&gt;
|-&lt;br /&gt;
|41 || empty check box&lt;br /&gt;
|-&lt;br /&gt;
|42 || checked check box&lt;br /&gt;
|-&lt;br /&gt;
|43 || warning sign&lt;br /&gt;
|-&lt;br /&gt;
|44 || window resize right&lt;br /&gt;
|-&lt;br /&gt;
|45 .. 48|| arrows&lt;br /&gt;
|-&lt;br /&gt;
|49 || house&lt;br /&gt;
|-&lt;br /&gt;
|50 || shared orders&lt;br /&gt;
|-&lt;br /&gt;
|51 .. 52 || pin / pinned&lt;br /&gt;
|-&lt;br /&gt;
|53 .. 62 || rail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|63 .. 68 || monorail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|69 .. 74 || maglev build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|75 || ??&lt;br /&gt;
|-&lt;br /&gt;
|76 .. 77 || waypoint toolbar and cursor icon&lt;br /&gt;
|-&lt;br /&gt;
|78 .. 81 || waypoint buildings&lt;br /&gt;
|-&lt;br /&gt;
|82 .. 85 || autoroad toobar and cursor for road and trams&lt;br /&gt;
|-&lt;br /&gt;
|86 || helipad&lt;br /&gt;
|-&lt;br /&gt;
|87 || build ship lift cursor&lt;br /&gt;
|-&lt;br /&gt;
|88 .. 89 || build canal toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|90 || fast forward&lt;br /&gt;
|-&lt;br /&gt;
|91 .. 92 || level land toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|93 .. 96 || sell vehicle&lt;br /&gt;
|-&lt;br /&gt;
|97 .. 100 || sell all vehicles&lt;br /&gt;
|-&lt;br /&gt;
|101 .. 104 || replace vehicle&lt;br /&gt;
|-&lt;br /&gt;
|105 || sell chain of rail vehicles&lt;br /&gt;
|-&lt;br /&gt;
|106 .. 113 || clone vehicles button and cursors&lt;br /&gt;
|-&lt;br /&gt;
|114 .. 117 || create vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|118 .. 121 || delete vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|122 .. 125 || rename vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|126 .. 133 || group replace on / off button&lt;br /&gt;
|-&lt;br /&gt;
|134 || road toolbar: build one-way roads&lt;br /&gt;
|-&lt;br /&gt;
|135 || signal toolbar: convert signals&lt;br /&gt;
|-&lt;br /&gt;
|136 .. 137|| build rivers toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|138 .. 143 || OSK&lt;br /&gt;
|-&lt;br /&gt;
|144 || switch toolbar&lt;br /&gt;
|-&lt;br /&gt;
|145 .. 146 || build aqueduct toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|147 .. 148 || (+) and (-) icon&lt;br /&gt;
|-&lt;br /&gt;
|149 || window resize left&lt;br /&gt;
|-&lt;br /&gt;
|150 || play music right-to-left languages&lt;br /&gt;
|-&lt;br /&gt;
|151 .. 152 || shade / unshade&lt;br /&gt;
|-&lt;br /&gt;
|153 || debug&lt;br /&gt;
|-&lt;br /&gt;
|154 .. 157 || vehicle profit icons&lt;br /&gt;
|-&lt;br /&gt;
|158 || unread news&lt;br /&gt;
|-&lt;br /&gt;
|159 || exclusive transport rights&lt;br /&gt;
|-&lt;br /&gt;
|160 || autoreplace protection&lt;br /&gt;
|-&lt;br /&gt;
|161 || autoreplace defined&lt;br /&gt;
|-&lt;br /&gt;
|162 .. 165 || Town happiness indicator: N/A, appalling, mediocre and good&lt;br /&gt;
|-&lt;br /&gt;
|166 .. 167 || Icons for delete to the left resp. right&lt;br /&gt;
|-&lt;br /&gt;
|168 || Default window size&lt;br /&gt;
|-&lt;br /&gt;
|169 .. 173 || Story book: Main toolbar icon, goto place, unfinished goal, finished goal, broken goal&lt;br /&gt;
|-&lt;br /&gt;
|174 || Smallmap cargoflow button&lt;br /&gt;
|-&lt;br /&gt;
|175 .. 178 || Icons for group livery selection&lt;br /&gt;
|-&lt;br /&gt;
|179 .. 183 || NotRoadTypes toolbar and cursor icons&lt;br /&gt;
|-&lt;br /&gt;
|184 || {{ottd|1.11|g8dda0ec4f}} window title bar: rename vehicle/station/town/...&lt;br /&gt;
|-&lt;br /&gt;
|185 || {{ottd|1.11|g8dda0ec4f}} window title bar: go to location of vehicle/station/town/industry/...&lt;br /&gt;
|-&lt;br /&gt;
|186 .. 190 || {{ottd|1.12|gfda1a590f6}} multiplayer GUI: chat, admin action, join team, self player, host player&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 16 / 96 Airport preview sprites ====&lt;br /&gt;
[[File:airport_preview_commuter.png|right]]&lt;br /&gt;
Preview sprites for the airports in the order&lt;br /&gt;
# Small airport&lt;br /&gt;
# City airport&lt;br /&gt;
# Heliport&lt;br /&gt;
# Metropolitan airport&lt;br /&gt;
# International airport&lt;br /&gt;
# Commuter airport&lt;br /&gt;
# Heli depot&lt;br /&gt;
# Intercontinental airport&lt;br /&gt;
# Heli station&lt;br /&gt;
&lt;br /&gt;
Sprites are without any offsets and should all be the same size. Make sure so by using the forbid cropping.&lt;br /&gt;
&lt;br /&gt;
==== 17 / 97 Tunnel overlay sprites ====&lt;br /&gt;
[[File:tunnel_overlays.png|right]]&lt;br /&gt;
The sprites provide the ground for the tunnel sprites to be used by railtype NewGRFs which only need to provide the tunnel portals. They must be provided for both terrain types which could be used in any given climate (grass; grass+snow; grass+desert; grass).&lt;br /&gt;
&lt;br /&gt;
=== num-sprites ===&lt;br /&gt;
&lt;br /&gt;
The number of sprites that follow.&lt;br /&gt;
&lt;br /&gt;
Since TTDPatch 2.0.1 alpha 49, this value is an extended byte.&lt;br /&gt;
&lt;br /&gt;
Note that it is not generally an error to provide more sprites than required, but this does expend sprite slots unnecessarily.&lt;br /&gt;
&lt;br /&gt;
=== offset ===&lt;br /&gt;
&lt;br /&gt;
The offset in the Action 5 assignable block of sprites. This term is only read when bit 7 of the type has been set. It can be used to only replace a subset of sprites from a set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When creating a TTDPatch compatible grf, you have to skip the OpenTTD specific Action 05&#039;s using an Action 09 rather than an Action 07. Using the latter will result in an error on your Action 05 when using the grf in TTDPatch.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; NFORenum distinguishes Action5 with no offset and Action5 with offset 0. While they have technically the same effect, NFORenum assumes an Action5 with no offset has the intention to replace all sprites and checks the number of sprites accordingly. An Action5 with offset is considered to only replace a subset of the sprites, so the sprites are not checked for completeness.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Replace the piers for the aqueduct&lt;br /&gt;
 1457 * 3        05 12 02 06 // action5, type 12, 2 sprites, at offset 6 into that type&lt;br /&gt;
    9 sprites/png/terrain/waterfeatures.png 546 8 09 23 33 -26 0&lt;br /&gt;
   10 sprites/png/terrain/waterfeatures.png 594 8 09 23 33 -5 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4329</id>
		<title>Action5</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=Action5&amp;diff=4329"/>
		<updated>2022-12-26T20:29:23Z</updated>

		<summary type="html">&lt;p&gt;Flherne: Correct number of GUI sprites&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define base graphics specific sets&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Action 5 is used to define graphics for several new features of OpenTTD and TTDPatch. This is similar to action 1.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
The data looks as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Sprite-number&amp;gt; * &amp;lt;Length&amp;gt; 05 &amp;lt;type&amp;gt; &amp;lt;num-sprites&amp;gt; [&amp;lt;offset&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Element!![[GRFActionsDetailed|Size]]!!Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;Sprite-number&amp;gt;||dec||A sequential sprite number&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;length&amp;gt;||dec||The total number of bytes used in this action&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05||B||Defines action 05&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;type&amp;gt;||B||What type of graphics follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;num-sprites&amp;gt;||B*||How many regular sprites follow&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;offset&amp;gt;||B*||Offset in the Action 5 assignable block of sprites&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following num-sprites sprites in the .nfo file have to be RealSprites that will be used as graphics for the given TTDPatch feature, except for type 0A, which requires RecolorSprites.&lt;br /&gt;
&lt;br /&gt;
{{ottdp|0.7|2.5|ttdprev=alpha 19}}Action 5 entries in a .grf file which has a regular GRFID (not FFFFFFFF) will always override those from .grf files with a GRFID of FFFFFFFF.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Sprite-number ===&lt;br /&gt;
&lt;br /&gt;
This is just the number you are at.&lt;br /&gt;
&lt;br /&gt;
=== Length ===&lt;br /&gt;
&lt;br /&gt;
Count the number of bytes in this action.&lt;br /&gt;
&lt;br /&gt;
=== type ===&lt;br /&gt;
&lt;br /&gt;
This sets the type of feature that the graphics are for. If bit 7 is set, the offset variable needs to be set. Bit 7 may only be set if the type supports it. The type can be one of:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Type!!Version!!Feature!!num-sprites (decimal)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04||{{ottdp|0.6|2.0}}||Pre-signal and semaphore graphics||112&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|04,84&amp;lt;ref name=&amp;quot;offset&amp;quot;&amp;gt;Offset allowed since {{ottdp|1.2|no|ottdrev=r23005}}&amp;lt;/ref&amp;gt;||{{ottdp| |2.5|ttdprev=alpha 41}}||Pre-signal, semaphore, and PBS graphics||240&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|05,85&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.0}}||Overhead wires and pylon graphics||48&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06 ||{{ottdp|0.6| }}||Foundations (retaining walls) for BuildOnSlopes ||74&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06,86&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11321}}||Foundations for BuildOnSlopes and half tiles (NS and EW foundations) ||90&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|07||{{ottdp|no|2.5|ttdprev=alpha 43}}||TTDPatch GUI sprites||93 &amp;lt;ref&amp;gt;Type 07 only requires 73 sprites in the stable (2.5 branch); the extra sprites are the clone train and build canal cursors.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|08,88&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no}}&amp;lt;ref&amp;gt;TTDPatch supported canals via Action5 from 2.0.1 alpha 17 up to alpha 25. In alpha 26 it was removed again in favour of an action-1-2-3 method; see [[Action3/Canals|Action3]]. The method via Action5 is no longer supported by TTDpatch 2.0.1 alpha 26 and newer.&amp;lt;/ref&amp;gt;||Canals||65&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|09,89&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 58}}||One-way road arrows||6&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0A,8A&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 67}}||Two company color translation maps||256&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0B,8B&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.5|ttdprev=alpha 68}}||Tram tracks||113 {{ottdp|1.10|no}}119&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0C||{{ottdp|no|2.5|ttdprev=alpha 74}}||Snowy temperate trees||133&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0D||{{ottdp|0.6|2.5|ottdrev=r7325 (r11726)|ttdprev=beta 5}}||Coast Tile graphics||16 (18)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0E||{{ottdp|no|2.6|ttdprev=r1247}}||New Signals||Any&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0F,8F&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13469|ttdprev=r1487}}||Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP)||Up to 12&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|10,90&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r9645}}||Additional airport graphics||15&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|11,91&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|2.6|ottdrev=r9645|ttdprev=r1589}}||Road stop graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|12,92&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.7|2.6|ottdrev=r13464|ttdprev=r1498}}||Aqueduct graphics||8&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|13,93&amp;lt;ref name=&amp;quot;offset&amp;quot; /&amp;gt;||{{ottdp|0.6|no|ottdrev=r11433}}||Autorail sprites||55&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|14,94||{{ottdp|0.6 - 1.11|no|ottdrev=11433}}||Flag sprites (no longer used)||Up to 36&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|15,95||{{ottdp|0.6|no|ottdrev=r11433}}||OpenTTD GUI sprites||Up to 191&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|16,96||{{ottdp|1.1|no|ottdrev=r20370}}||Airport preview sprites||Up to 9&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|17,97||{{ottdp|1.2|no|ottdrev=r23952}}||Railtype tunnel base sprites||16&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|18,98||{{ottdp|1.5|no|ottdrev=r26869}}||Extra all black palette||1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 04 Signal graphics. ====&lt;br /&gt;
&lt;br /&gt;
Signal graphics come in groups of 16. These groups contain sprites in the same order as sprites 1275-1290 in trg1[r].grf; red, then green, for each of: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Group(s)!!Contents&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0||lighted entrance signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|1||lighted exit signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|2||lighted combo signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3||standard (non-pre-signal) semaphore signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4..6||repeat 0..2 for semaphores&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|7||standard lighted PBS signals&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|8..14||repeat 0..6 for PBS signals&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 0C Snowy temperate trees ====&lt;br /&gt;
&lt;br /&gt;
If the temperate snow line is enabled, you can use this to specify the snowy versions of temperate trees. The sprites must be the snowy versions of sprites 1576-1708 from TRG1.GRF, in the same order as they appear there.&lt;br /&gt;
&lt;br /&gt;
==== 0D Coast tile sprites ====&lt;br /&gt;
&lt;br /&gt;
===== In NewGRFs =====&lt;br /&gt;
If diagonal flooding is enabled then due to new corner coasts, you can use this to give a complete set of replacement coast tile sprites. There are 16 in total, 8 original Transport Tycoon Deluxe sprites and 8 for the corner slopes. Order of the sprites&amp;lt;ref name=numbers&amp;gt;Sprite numbers from trg1(r).pcx.&amp;lt;/ref&amp;gt; is as follows:&lt;br /&gt;
&lt;br /&gt;
 3997, 4063, 4064, 4068, 4062, 3998, 4066, 3988,&lt;br /&gt;
 4065, 4069, 3996, 3992, 4067, 3994, 3995, 3999.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast16Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The 16 sprites for feature 0D&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===== In Base Set&#039;s extra grf =====&lt;br /&gt;
Additionally, OpenTTD (since r11726) supports another method of supplying all additional coast tile sprites, but this is only allowed in the &#039;&#039;extra&#039;&#039; NewGRF of [http://wiki.openttd.org/Base_graphics Base Graphic Sets]. In this, only 10 sprites are supplied in the same order as the 16 sprites above, but without the coast sprites already in the base grf. Note that the 10 sprites version supplies two additional slopes, but they are not used, and are currently unlikely to be ever used.&lt;br /&gt;
&lt;br /&gt;
[[File:Action5Coast10Sprites.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Only 10 sprites are required for OpenTTD base graphic sets&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;In OpenTTD 10 sprites for type 0D is enough in base graphic sets. The 16 sprites version should not be used for base graphics.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason for the existence of a 10 sprite version is to remove the need for including original graphics, and to keep compatibility with old NewGRFs that replace the original shore graphics using Action A without adding new shores using Action 5: When a NewGRF uses the 16 sprites version it takes precedence above any NewGRF replacing the shore graphics using Action A; when a NewGRF uses Action A to replace shore graphics it takes precedence above a 10-sprite Action 5, effectively disabling diagonal flooding. Also due to compatibility the 10 sprites version is invalid for normal NewGRFs, which are not the &amp;quot;extra&amp;quot; NewGRF of some Base Graphics Set.&lt;br /&gt;
&lt;br /&gt;
==== 0E New Signals ====&lt;br /&gt;
&lt;br /&gt;
Any number of real and recolour sprites can be specified in the action in any order.&lt;br /&gt;
&lt;br /&gt;
Sprites are referenced by their offset into the action5 block by a [[VarAction2NewSignals]], hence a logically easily calculable order is advised.&lt;br /&gt;
&lt;br /&gt;
As of TTDPatch 2.6 alpha 0 r1346, the action 5 block defined in the same GRF file as the varaction2, will be used as the base sprite block for the offsets returned by the callback even if it is overridden by a higher priority GRF action 5 definition of the same feature (0E).&lt;br /&gt;
&lt;br /&gt;
==== 0F Tracks for Slopes ====&lt;br /&gt;
&lt;br /&gt;
This should be in the same order as sprites 1031 to 1035 (1). These should only be the rails, basically the same format as sprites 1005 to 1010 (1). There should be 3 groups of these sprites, one for each rail type (railroad, monorail, maglev).&lt;br /&gt;
&lt;br /&gt;
(1) Sprite numbers from trg1r.pcx / ogfx1_base.grf&lt;br /&gt;
&lt;br /&gt;
==== 11 Road stop graphics ====&lt;br /&gt;
&lt;br /&gt;
Road stop graphics consist of 2 groups of 4 sprites. The first group contains graphics for bus stops, second for truck stops. In each group, the sprites are in the following order: SW, NE, NW, SE.&lt;br /&gt;
&lt;br /&gt;
SW and NE sprites are used with road going along the Y axis ( .\&#039; ), NW and SE with road along the X axis( &#039;/. ).&lt;br /&gt;
&lt;br /&gt;
Internally, the stations are defined using the following station layouts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1313&lt;br /&gt;
&lt;br /&gt;
\b13 \b0 \b0 \b3 \b16 \b16 &amp;lt;SW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b3 \b16 \b16 &amp;lt;NE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;\d1314&lt;br /&gt;
&lt;br /&gt;
\b0 \b0 \b0 \b16 \b3 \b16 &amp;lt;NW sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\b0 \b13 \b0 \b16 \b3 \b16 &amp;lt;SE sprite&amp;gt;&lt;br /&gt;
&lt;br /&gt;
80&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where 1313 and 1314 are town road sprites.&lt;br /&gt;
&lt;br /&gt;
[[File:roadstops.png]]&lt;br /&gt;
&lt;br /&gt;
Further sprites can be found in &#039;&#039;&#039;openttd.grf&#039;&#039;&#039; (OpenTTD), &#039;&#039;&#039;ogfxe_extra.grf&#039;&#039;&#039; (OpenGFX) or &#039;&#039;&#039;ttdpbase(w).grf&#039;&#039;&#039; (TTDPatch).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As of OpenTTD r10185, the behaviour of this feature is identical in both games.&lt;br /&gt;
&lt;br /&gt;
==== 12 Aqueducts ====&lt;br /&gt;
&lt;br /&gt;
8 real sprites should be given. Firstly: 4 bridge end sprites in the order: SW, SE, NE, NW, where the direction is that heading onto the aqueduct. Then 2 middle part sprites for the X and Y directions. Followed by two pillar sprites for the X and Y directions. For examples of where the division between middle sprites and pillars should be made see sprites 2437 to 2592 (1), or an existing aqueduct GRF. Note, that for higher bridges to work effectively, pillars should be approximately 8px in height.&lt;br /&gt;
&lt;br /&gt;
[[File:aqueduct.png]]&lt;br /&gt;
&lt;br /&gt;
==== 15 / 95 OpenTTD GUI sprites ====&lt;br /&gt;
&lt;br /&gt;
OpenTTD defines 190 GUI sprites. Additional sprites not needed by an OpenTTD are simply ignored, so that new(er) base sets can be used by old OpenTTD versions. One can (re-)define a subset of the GUI sprites by giving an offset into the GUI sprites. The sprites are:&lt;br /&gt;
{|&lt;br /&gt;
!Offset !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0 .. 11|| Halftile selections&lt;br /&gt;
|-&lt;br /&gt;
|12 .. 13 || Title screen letters E and D&lt;br /&gt;
|-&lt;br /&gt;
|14 .. 37 || Bridge piers colours 1 .. 4&lt;br /&gt;
|-&lt;br /&gt;
|38 || square indicating NewGRF compatibility&lt;br /&gt;
|-&lt;br /&gt;
|39 || blob indicating server compatibility&lt;br /&gt;
|-&lt;br /&gt;
|40 || lock icon&lt;br /&gt;
|-&lt;br /&gt;
|41 || empty check box&lt;br /&gt;
|-&lt;br /&gt;
|42 || checked check box&lt;br /&gt;
|-&lt;br /&gt;
|43 || warning sign&lt;br /&gt;
|-&lt;br /&gt;
|44 || window resize right&lt;br /&gt;
|-&lt;br /&gt;
|45 .. 48|| arrows&lt;br /&gt;
|-&lt;br /&gt;
|49 || house&lt;br /&gt;
|-&lt;br /&gt;
|50 || shared orders&lt;br /&gt;
|-&lt;br /&gt;
|51 .. 52 || pin / pinned&lt;br /&gt;
|-&lt;br /&gt;
|53 .. 62 || rail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|63 .. 68 || monorail build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|69 .. 74 || maglev build icons and cursors&lt;br /&gt;
|-&lt;br /&gt;
|75 || ??&lt;br /&gt;
|-&lt;br /&gt;
|76 .. 77 || waypoint toolbar and cursor icon&lt;br /&gt;
|-&lt;br /&gt;
|78 .. 81 || waypoint buildings&lt;br /&gt;
|-&lt;br /&gt;
|82 .. 85 || autoroad toobar and cursor for road and trams&lt;br /&gt;
|-&lt;br /&gt;
|86 || helipad&lt;br /&gt;
|-&lt;br /&gt;
|87 || build ship lift cursor&lt;br /&gt;
|-&lt;br /&gt;
|88 .. 89 || build canal toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|90 || fast forward&lt;br /&gt;
|-&lt;br /&gt;
|91 .. 92 || level land toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|93 .. 96 || sell vehicle&lt;br /&gt;
|-&lt;br /&gt;
|97 .. 100 || sell all vehicles&lt;br /&gt;
|-&lt;br /&gt;
|101 .. 104 || replace vehicle&lt;br /&gt;
|-&lt;br /&gt;
|105 || sell chain of rail vehicles&lt;br /&gt;
|-&lt;br /&gt;
|106 .. 113 || clone vehicles button and cursors&lt;br /&gt;
|-&lt;br /&gt;
|114 .. 117 || create vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|118 .. 121 || delete vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|122 .. 125 || rename vehicle group button&lt;br /&gt;
|-&lt;br /&gt;
|126 .. 133 || group replace on / off button&lt;br /&gt;
|-&lt;br /&gt;
|134 || road toolbar: build one-way roads&lt;br /&gt;
|-&lt;br /&gt;
|135 || signal toolbar: convert signals&lt;br /&gt;
|-&lt;br /&gt;
|136 .. 137|| build rivers toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|138 .. 143 || OSK&lt;br /&gt;
|-&lt;br /&gt;
|144 || switch toolbar&lt;br /&gt;
|-&lt;br /&gt;
|145 .. 146 || build aqueduct toolbar and cursor&lt;br /&gt;
|-&lt;br /&gt;
|147 .. 148 || (+) and (-) icon&lt;br /&gt;
|-&lt;br /&gt;
|149 || window resize left&lt;br /&gt;
|-&lt;br /&gt;
|150 || play music right-to-left languages&lt;br /&gt;
|-&lt;br /&gt;
|151 .. 152 || shade / unshade&lt;br /&gt;
|-&lt;br /&gt;
|153 || debug&lt;br /&gt;
|-&lt;br /&gt;
|154 .. 157 || vehicle profit icons&lt;br /&gt;
|-&lt;br /&gt;
|158 || unread news&lt;br /&gt;
|-&lt;br /&gt;
|159 || exclusive transport rights&lt;br /&gt;
|-&lt;br /&gt;
|160 || autoreplace protection&lt;br /&gt;
|-&lt;br /&gt;
|161 || autoreplace defined&lt;br /&gt;
|-&lt;br /&gt;
|162 .. 165 || Town happiness indicator: N/A, appalling, mediocre and good&lt;br /&gt;
|-&lt;br /&gt;
|166 .. 167 || Icons for delete to the left resp. right&lt;br /&gt;
|-&lt;br /&gt;
|168 || Default window size&lt;br /&gt;
|-&lt;br /&gt;
|169 .. 173 || Story book: Main toolbar icon, goto place, unfinished goal, finished goal, broken goal&lt;br /&gt;
|-&lt;br /&gt;
|174 || Smallmap cargoflow button&lt;br /&gt;
|-&lt;br /&gt;
|175 .. 178 || Icons for group livery selection&lt;br /&gt;
|-&lt;br /&gt;
|179 .. 183 || NotRoadTypes toolbar and cursor icons&lt;br /&gt;
|-&lt;br /&gt;
|184 || {{ottd|1.11|g8dda0ec4f}} window title bar: rename vehicle/station/town/...&lt;br /&gt;
|-&lt;br /&gt;
|185 || {{ottd|1.11|g8dda0ec4f}} window title bar: go to location of vehicle/station/town/industry/...&lt;br /&gt;
|-&lt;br /&gt;
|186 .. 190 || {{ottd|1.12|gfda1a590f6}} multiplayer GUI: chat, admin action, join team, self player, host player&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 16 / 96 Airport preview sprites ====&lt;br /&gt;
[[File:airport_preview_commuter.png|right]]&lt;br /&gt;
Preview sprites for the airports in the order&lt;br /&gt;
# Small airport&lt;br /&gt;
# City airport&lt;br /&gt;
# Heliport&lt;br /&gt;
# Metropolitan airport&lt;br /&gt;
# International airport&lt;br /&gt;
# Commuter airport&lt;br /&gt;
# Heli depot&lt;br /&gt;
# Intercontinental airport&lt;br /&gt;
# Heli station&lt;br /&gt;
&lt;br /&gt;
Sprites are without any offsets and should all be the same size. Make sure so by using the forbid cropping.&lt;br /&gt;
&lt;br /&gt;
==== 17 / 97 Tunnel overlay sprites ====&lt;br /&gt;
[[File:tunnel_overlays.png|right]]&lt;br /&gt;
The sprites provide the ground for the tunnel sprites to be used by railtype NewGRFs which only need to provide the tunnel portals. They must be provided for both terrain types which could be used in any given climate (grass; grass+snow; grass+desert; grass).&lt;br /&gt;
&lt;br /&gt;
=== num-sprites ===&lt;br /&gt;
&lt;br /&gt;
The number of sprites that follow.&lt;br /&gt;
&lt;br /&gt;
Since TTDPatch 2.0.1 alpha 49, this value is an extended byte.&lt;br /&gt;
&lt;br /&gt;
Note that it is not generally an error to provide more sprites than required, but this does expend sprite slots unnecessarily.&lt;br /&gt;
&lt;br /&gt;
=== offset ===&lt;br /&gt;
&lt;br /&gt;
The offset in the Action 5 assignable block of sprites. This term is only read when bit 7 of the type has been set. It can be used to only replace a subset of sprites from a set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When creating a TTDPatch compatible grf, you have to skip the OpenTTD specific Action 05&#039;s using an Action 09 rather than an Action 07. Using the latter will result in an error on your Action 05 when using the grf in TTDPatch.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; NFORenum distinguishes Action5 with no offset and Action5 with offset 0. While they have technically the same effect, NFORenum assumes an Action5 with no offset has the intention to replace all sprites and checks the number of sprites accordingly. An Action5 with offset is considered to only replace a subset of the sprites, so the sprites are not checked for completeness.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Replace the piers for the aqueduct&lt;br /&gt;
 1457 * 3        05 12 02 06 // action5, type 12, 2 sprites, at offset 6 into that type&lt;br /&gt;
    9 sprites/png/terrain/waterfeatures.png 546 8 09 23 33 -26 0&lt;br /&gt;
   10 sprites/png/terrain/waterfeatures.png 594 8 09 23 33 -5 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
	<entry>
		<id>https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=4104</id>
		<title>NML:Vehicles</title>
		<link rel="alternate" type="text/html" href="https://newgrf-specs.tt-wiki.net/index.php?title=NML:Vehicles&amp;diff=4104"/>
		<updated>2021-04-17T10:13:01Z</updated>

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

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

		<summary type="html">&lt;p&gt;Flherne: Add roadtype and tramtype builtins.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NMLNavExpressions}}&lt;br /&gt;
&lt;br /&gt;
Available builtin functions are&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;t&amp;quot;&lt;br /&gt;
! Function&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| min(&#039;&#039;v1&#039;&#039;, &#039;&#039;v2&#039;&#039;)&lt;br /&gt;
| Return the smallest value&lt;br /&gt;
|-&lt;br /&gt;
| max(&#039;&#039;v1&#039;&#039;, &#039;&#039;v2&#039;&#039;)&lt;br /&gt;
| Return the biggest value&lt;br /&gt;
|-&lt;br /&gt;
| date(&#039;&#039;year&#039;&#039;, &#039;&#039;month&#039;&#039;, &#039;&#039;day&#039;&#039;)&lt;br /&gt;
| If all values are constants, returns the number of days since year 0. If the year is a variable, the month and day should be 1.&lt;br /&gt;
|-&lt;br /&gt;
| day_of_year(&#039;&#039;month&#039;&#039;, &#039;&#039;day&#039;&#039;)&lt;br /&gt;
| Return the day of the year since January 1st. Both values must be compile-time constants.&lt;br /&gt;
|-&lt;br /&gt;
| bitmask(&#039;&#039;bitpos1&#039;&#039;, ...)&lt;br /&gt;
| Compose an integer by switching the bits at the given positions on.&lt;br /&gt;
|-&lt;br /&gt;
| STORE_TEMP(&#039;&#039;value&#039;&#039;, &#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Store value in temporary storage&lt;br /&gt;
|-&lt;br /&gt;
| STORE_PERM(&#039;&#039;value&#039;&#039;, &#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Store value in permanent storage (industries, airports, towns only). Since {{ottd|1.9}} up to 256 registers are available. Note that accessing permanent town registers thrashes the contents of temporary register 0x100.&lt;br /&gt;
|-&lt;br /&gt;
| LOAD_TEMP(&#039;&#039;address&#039;&#039;)&lt;br /&gt;
| Get value from temporary storage&lt;br /&gt;
|-&lt;br /&gt;
| LOAD_PERM(&#039;&#039;address [, grfid]&#039;&#039;)&lt;br /&gt;
| Get value from permanent storage (industries, airports, towns only). For towns only, specifying a grfid (4-byte string, optional) allows reading the storage of other grfs. Note that accessing permanent town registers thrashes the contents of temporary register 0x100.&lt;br /&gt;
|-&lt;br /&gt;
| hasbit(&#039;&#039;value&#039;&#039;, &#039;&#039;bit_num&#039;&#039;)&lt;br /&gt;
| Test whether a bit in a value is on&lt;br /&gt;
|-&lt;br /&gt;
| getbits(&#039;&#039;value&#039;&#039;, &#039;&#039;first&#039;&#039;, &#039;&#039;amount&#039;&#039;)&lt;br /&gt;
| {{nml|0.4.1}} Extract some bits from a value. Result is (value &amp;gt;&amp;gt; first) &amp;amp; (1 &amp;lt;&amp;lt; amount - 1)&lt;br /&gt;
|-&lt;br /&gt;
| version_openttd(&#039;&#039;major&#039;&#039;, &#039;&#039;minor&#039;&#039;, &#039;&#039;revision&#039;&#039;[, &#039;&#039;build&#039;&#039;])&lt;br /&gt;
| Return the constant representing an OpenTTD version&lt;br /&gt;
|-&lt;br /&gt;
| cargotype_available(&#039;&#039;cargotype&#039;&#039;)&lt;br /&gt;
| Check if a certain cargo type is available in this game. &#039;&#039;cargotype&#039;&#039; must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| railtype_available(&#039;&#039;railtype&#039;&#039;)&lt;br /&gt;
| Check if a railtype is available in this game. &#039;&#039;railtype&#039;&#039; must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| roadtype_available(&#039;&#039;roadtype&#039;&#039;)&lt;br /&gt;
| Check if a roadtype is available in this game. &#039;&#039;roadtype&#039;&#039; must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| tramtype_available(&#039;&#039;tramtype_available&#039;&#039;)&lt;br /&gt;
| Check if a tramtype_available is available in this game. &#039;&#039;tramtype_available&#039;&#039; must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| grf_current_status(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| 1 if the given GRF is currently active 0, otherwise. If &#039;&#039;mask&#039;&#039; is set, only the bits set in the mask will be tested. Both parameters must be a literal string of length 4.&lt;br /&gt;
|-&lt;br /&gt;
| grf_future_status(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| Same as above, but tests whether the grf will become active instead of whether it&#039;s currently active.&lt;br /&gt;
|-&lt;br /&gt;
| grf_order_behind(&#039;&#039;grfid[, mask]&#039;&#039;)&lt;br /&gt;
| Same as above, but tests whether current grf will become active in the order behind the referenced grf.&lt;br /&gt;
|-&lt;br /&gt;
| create_effect(&#039;&#039;effect_sprite&#039;&#039;, &#039;&#039;l_x_offset&#039;&#039;, &#039;&#039;t_y_offset&#039;&#039;, &#039;&#039;z_offset&#039;&#039;)&lt;br /&gt;
| Helper function for the vehicle callback &#039;create_effect&#039;.&lt;br /&gt;
* &#039;&#039;effect_sprite&#039;&#039;: Sprite for the effect. One of EFFECT_SPRITE_[NONE|STEAM|DIESEL|ELECTRIC|AIRCRAFT_BREAKDOWN_SMOKE].&lt;br /&gt;
* &#039;&#039;l_x_offset&#039;&#039;: Longitudinal or X position of the effect, depending on callback result CB_RESULT_CREATE_EFFECT_NO_ROTATION.&lt;br /&gt;
* &#039;&#039;t_y_offset&#039;&#039;: Transversal or Y position of the effect, depending on callback result CB_RESULT_CREATE_EFFECT_NO_ROTATION.&lt;br /&gt;
* &#039;&#039;z_offset&#039;&#039;: Z position of the effect.&lt;br /&gt;
|-&lt;br /&gt;
| visual_effect_and_powered(&#039;&#039;effect&#039;&#039;, &#039;&#039;offset&#039;&#039;, &#039;&#039;powered&#039;&#039;&lt;br /&gt;
| Helper function for the train property visual_effect_and_powered and the VEH_CB_VISUAL_EFFECT_AND_POWERED callback.&lt;br /&gt;
|-&lt;br /&gt;
| str2number(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Interpret the given string as a dword and return the value as integer.&lt;br /&gt;
|-&lt;br /&gt;
| cargotype(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Return the index of the given cargo type in the cargo translation table.&lt;br /&gt;
|-&lt;br /&gt;
| railtype(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Return the index of the given railtype in the railtype translation table.&lt;br /&gt;
|-&lt;br /&gt;
| roadtype(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Return the index of the given roadtype in the roadtype translation table.&lt;br /&gt;
|-&lt;br /&gt;
| tramtype(&#039;&#039;4-byte long string&#039;&#039;)&lt;br /&gt;
| Return the index of the given tramtype in the tramtype translation table.&lt;br /&gt;
|-&lt;br /&gt;
| reserve_sprites(&#039;&#039;number of sprites&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Reserve a number of sprites in the TTD sprite range. This is needed if you want to use your own recolour sprites. Example:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
 param[10] = reserve_sprites(1);&lt;br /&gt;
 replace(param[10]) {&lt;br /&gt;
 	recolour_sprite {&lt;br /&gt;
 		// your colour remap.&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
 spritelayout xyz {&lt;br /&gt;
 	building {&lt;br /&gt;
 		...&lt;br /&gt;
 		recolour: param[10];&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| int(&#039;&#039;v1&#039;&#039;)&lt;br /&gt;
| Converts v1 to an int. This is done by cutting off everything after the decimal point.&lt;br /&gt;
|-&lt;br /&gt;
| abs(&#039;&#039;v1&#039;&#039;)&lt;br /&gt;
| Return the absolute value of v1.&lt;br /&gt;
|-&lt;br /&gt;
| acos / asin / atan / cos / sin / tan&lt;br /&gt;
| Standard trigonometric functions.&lt;br /&gt;
|-&lt;br /&gt;
| CMP(&#039;&#039;param1, param2&#039;&#039;)&lt;br /&gt;
| Compares param1 and param2 (considering them as signed values). Returns CMP_LESS if param1 is less than param2, CMP_EQUAL if they are equal and CMP_GREATER if param1 is greater than param2.&lt;br /&gt;
|-&lt;br /&gt;
| UCMP(&#039;&#039;param1, param2&#039;&#039;)&lt;br /&gt;
| Compares param1 and param2 (considering them as unsigned values). Returns CMP_LESS if param1 is less than param2, CMP_EQUAL if they are equal and CMP_GREATER if param1 is greater than param2.&lt;br /&gt;
|-&lt;br /&gt;
| rotate(&#039;&#039;value, amount&#039;&#039;)&lt;br /&gt;
| Rotates &#039;&#039;value&#039;&#039; to the right &#039;&#039;amount&#039;&#039; steps. This is always a 32 bits rotation.&lt;br /&gt;
|-&lt;br /&gt;
| sound(&#039;&#039;soundfile[, volume]&#039;&#039;)&lt;br /&gt;
| Import sound from .wav-file &#039;&#039;soundfile&#039;&#039; into the grf file and return its numeric ID. Including a file multiple times will not cause it to be duplicated. Loaded sound files must be in WAV format, PCM encoding:&lt;br /&gt;
* mono&lt;br /&gt;
* 8-bit or {{ottdp|1.0|no}} 16-bit&lt;br /&gt;
* 11025 Hz, 22050 Hz or 44100 Hz.&lt;br /&gt;
&#039;&#039;volume&#039;&#039; is in the [0, 100] range, the default value (if not set) is 100.&lt;br /&gt;
|-&lt;br /&gt;
| import_sound(&#039;&#039;grfid, id[, volume]&#039;&#039;)&lt;br /&gt;
| Import sound from a different grf file. &#039;&#039;grfid&#039;&#039; refers to the grf-file to import the sound from. &#039;&#039;id&#039;&#039; is the zero-based internal ID of the sound within the other grf-file. &#039;&#039;volume&#039;&#039; is in the [0, 100] range, the default value (if not set) is 100.&lt;br /&gt;
|-&lt;br /&gt;
| relative_coord(&#039;&#039;x, y&#039;&#039;)&lt;br /&gt;
| Returns the coordinates in &#039;&#039;0xYYXX&#039;&#039; format. x and y must be in the [0, 255] range.&lt;br /&gt;
|-&lt;br /&gt;
| num_corners_raised(&#039;&#039;slope&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the number of corners raised in a slope. Return value is 0 .. 3 for normal slopes and 4 for steep ones. See also [[NML:List of tile slopes|here]] for more information about slopes. Using this on values that are not slopes results in undefined behaviour.&lt;br /&gt;
|-&lt;br /&gt;
| slope_to_sprite_offset(&#039;&#039;slope&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the sprite offset corresponding to a given slope. Return value is in range 0 .. 18. See also [[NML:List of tile slopes|here]] for more information about slopes. The section on [[NML:Spritelayout|spritelayouts]] contains some more information one possible uses, as well as an example. Using this on values that are not slopes results in undefined behaviour.&lt;br /&gt;
|-&lt;br /&gt;
| palette_1cc(&#039;&#039;colour&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the 1cc palette for the given company colour, see [[NML:List_of_default_colour_translation_palettes#Company colour helper functions|here]] for more info.&lt;br /&gt;
|-&lt;br /&gt;
| palette_2cc(&#039;&#039;colour1&#039;&#039;, &#039;&#039;colour2&#039;&#039;)&lt;br /&gt;
|&lt;br /&gt;
Returns the 2cc palette for the given first and second company colour, see [[NML:List_of_default_colour_translation_palettes#Company colour helper functions|here]] for more info.&lt;br /&gt;
|-&lt;br /&gt;
| vehicle_curv_info(&#039;&#039;prev_cur&#039;&#039;, &#039;&#039;cur_next&#039;&#039;)&lt;br /&gt;
| Returns the curvature state of a vehicle, given the direction differences between the (previous-current) and (current-next) vehicle pairs. For use with the vehicle variable &amp;lt;code style=&amp;quot;color:darkgreen&amp;quot;&amp;gt;curv_info&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| format_string(&#039;&#039;format&#039;&#039;, args)&lt;br /&gt;
| Use the python string formatting functions to create a literal string. Keep in mind that the output is a literal string which cannot be used by string(). This function can however be used to create filenames.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Flherne</name></author>
	</entry>
</feed>