Difference between revisions of "Action5"

From GRFSpecs
Jump to navigationJump to search
m (13 revisions)
(Add Action 5 type 19: road waypoints)
 
(61 intermediate revisions by 11 users not shown)
Line 1: Line 1:
  +
== Introduction ==
   
'''''Define TTDPatch specific graphics sets'''''
 
   
  +
Define base graphics specific sets
=Action 5=
 
   
Define TTDPatch specific graphics sets
 
   
  +
Action 5 is used to define graphics for several new features of OpenTTD and TTDPatch. This is similar to action 1.
-=Introduction=-
 
   
  +
== Syntax ==
Action 5 is used to define graphics for several new features of TTDPatch.  This is similar to action 1.
 
 
-=Format=-
 
   
 
The data looks as follows:
 
The data looks as follows:
   
<pre> -+&lt;Sprite-number&gt; * &lt;Length&gt; 05 &lt;type&gt; &lt;num-sprites&gt;+-</pre>
+
<Sprite-number> * <Length> 05 <type> <num-sprites> [<offset>]
   
  +
{|
||'''Element'''|[[GRFActionsDetailed|'''Size''']]|'''Description'''
 
  +
!Element!![[GRFActionsDetailed|Size]]!!Description
   
  +
|-
&lt;Sprite-number&gt;|dec|A sequential sprite number
 
  +
|<Sprite-number>||dec||A sequential sprite number
   
  +
|-
&lt;length&gt;|dec|The total number of bytes used in this action
 
  +
|<length>||dec||The total number of bytes used in this action
   
  +
|-
05|B|Defines action 05
 
  +
|05||B||Defines action 05
   
  +
|-
&lt;type&gt;|B|What type of graphics follow
 
  +
|<type>||B||What type of graphics follow
   
  +
|-
&lt;num-sprites&gt;|B*|How many regular sprites follow
 
  +
|<num-sprites>||B*||How many regular sprites follow
   
  +
|-
&lt;offset&gt;|B*|Offset in the Action 5 assignable block of sprites||
 
  +
|<offset>||B*||Offset in the Action 5 assignable block of sprites
  +
|}
   
 
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.
 
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.
   
Action 5 entries in a .grf file which has a regular GRF ID (not FFFFFFFF) will always override those from .grf files with a GRF ID of FFFFFFFF (starting from 2.0.1 alpha 19).
+
{{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.
   
  +
== Description ==
-=Filling in the terms=-
 
   
===Sprite-number===
+
=== Sprite-number ===
   
 
This is just the number you are at.
 
This is just the number you are at.
   
===Length===
+
=== Length ===
   
 
Count the number of bytes in this action.
 
Count the number of bytes in this action.
   
===type===
+
=== type ===
   
 
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:
 
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:
   
  +
{|
||Type|Feature|num-sprites (decimal)|Minimum version
 
  +
!Type!!Version!!Feature!!num-sprites (decimal)
   
  +
|-
04|Pre-signal graphics|48
 
  +
|04||{{ottdp|0.6|2.0}}||Pre-signal graphics||48
   
  +
|-
04|Pre-signal and semaphore graphics|112
 
  +
|04||{{ottdp|0.6|2.0}}||Pre-signal and semaphore graphics||112
   
  +
|-
04|Pre-signal, semaphore, and [[PathBasedSignalling|PBS]] graphics|240|2.0.1 alpha 41
 
  +
|04,84<ref name="offset">Offset allowed since {{ottdp|1.2|no|ottdrev=r23005}}</ref>||{{ottdp| |2.5|ttdprev=alpha 41}}||Pre-signal, semaphore, and PBS graphics||240
   
  +
|-
05|Overhead wires and pylon graphics|48
 
  +
|05,85<ref name="offset" />||{{ottdp|0.6|2.0}}||Overhead wires and pylon graphics||48
   
  +
|-
06|Foundations (retaining walls) for BuildOnSlopes |74
 
  +
|06 ||{{ottdp|0.6| }}||Foundations (retaining walls) for BuildOnSlopes ||74
   
  +
|-
06|Foundations for BuildOnSlopes and half tiles (NS and EW foundations) |90|OpenTTD r11321
 
  +
|06,86<ref name="offset" />||{{ottdp|0.6|no|ottdrev=r11321}}||Foundations for BuildOnSlopes and half tiles (NS and EW foundations) ||90
   
  +
|-
07 (a)|GUI sprites|93|2.0.1 alpha 43
 
  +
|07||{{ottdp|no|2.5|ttdprev=alpha 43}}||TTDPatch GUI sprites||93 <ref>Type 07 only requires 73 sprites in the stable (2.5 branch); the extra sprites are the clone train and build canal cursors.</ref>
   
  +
|-
08|Canals|65|2.0.1 alpha 17
 
  +
|08,88<ref name="offset" />||{{ottdp|0.6|no}}<ref>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.</ref>||Canals||65
   
  +
|-
09|One-way road arrows|6|2.0.1 alpha 58
 
  +
|09,89<ref name="offset" />||{{ottdp|0.6|2.5|ttdprev=alpha 58}}||One-way road arrows||{{ottdp|13|no}} 18 {{ottdp|0.6 - 12|2.5}} 6
   
  +
|-
0A|Two company color translation maps|256|2.0.1 alpha 67
 
  +
|0A,8A<ref name="offset" />||{{ottdp|0.6|2.5|ttdprev=alpha 67}}||Two company color translation maps||256
   
  +
|-
0B|Tram tracks|113|2.0.1 alpha 68
 
  +
|0B,8B<ref name="offset" />||{{ottdp|0.6|2.5|ttdprev=alpha 68}}||Tram tracks||{{ottdp|1.10|no}} 119 {{ottdp|0.6 - 1.9|2.5}} 113
   
  +
|-
0C|Snowy temperate trees|133|2.0.1 alpha 74
 
  +
|0C||{{ottdp|no|2.5|ttdprev=alpha 74}}||Snowy temperate trees||133
   
  +
|-
0D|Coast Tile graphics|16 (18)|2.5 beta 5, OpenTTD r7325 (OpenTTD r11726)
 
  +
|0D||{{ottdp|0.6|2.5|ottdrev=r7325 (r11726)|ttdprev=beta 5}}||Coast Tile graphics||16 (18)
   
  +
|-
0E|New Signals|Any|2.6 alpha 0 r1247
 
  +
|0E||{{ottdp|no|2.6|ttdprev=r1247}}||New Signals||Any
   
  +
|-
0F|Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP)|12|2.6 alpha 0 r1487, OpenTTD r13469
 
  +
|0F,8F<ref name="offset" />||{{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
   
  +
|-
10|Additional airport graphics|15|OpenTTD r9645
 
  +
|10,90<ref name="offset" />||{{ottdp|0.6|no|ottdrev=r9645}}||Additional airport graphics||15
   
  +
|-
11|Road stop graphics|8|OpenTTD r9645, 2.6 alpha 0 r1589
 
  +
|11,91<ref name="offset" />||{{ottdp|0.6|2.6|ottdrev=r9645|ttdprev=r1589}}||Road stop graphics||8
   
  +
|-
12|Aqueduct graphics|8|2.6 alpha 0 r1498, OpenTTD r13464
 
  +
|12,92<ref name="offset" />||{{ottdp|0.7|2.6|ottdrev=r13464|ttdprev=r1498}}||Aqueduct graphics||8
   
  +
|-
13|Autorail sprites|55|OpenTTD r11433
 
  +
|13,93<ref name="offset" />||{{ottdp|0.6|no|ottdrev=r11433}}||Autorail sprites||55
   
  +
|-
14,94|Flag sprites|Up to 36|OpenTTD r11433
 
  +
|14,94||{{ottdp|0.6 - 1.11|no|ottdrev=11433}}||Flag sprites (no longer used)||Up to 36
   
  +
|-
15,95|OpenTTD GUI sprites|Up to 160|OpenTTD r11433
 
  +
|15,95||{{ottdp|0.6|no|ottdrev=r11433}}||OpenTTD GUI sprites||Up to 191
   
  +
|-
16,96|Airport preview sprites|Up to 9|OpenTTD r20370
 
  +
|16,96||{{ottdp|1.1|no|ottdrev=r20370}}||Airport preview sprites||Up to 9
   
||
+
|-
  +
|17,97||{{ottdp|1.2|no|ottdrev=r23952}}||Railtype tunnel base sprites||16
   
  +
|-
(a) Type 07 only requires 73 sprites in the stable (2.5 branch); the extra sprites are the clone train and build canal cursors.
 
  +
|18,98||{{ottdp|1.5|no|ottdrev=r26869}}||Extra all black palette||1
   
  +
|-
====04 Signal graphics.====
 
  +
|19,99||{{ottdp|15|no|}}||Road waypoint graphics||4
  +
|}
   
  +
<references/>
Signal graphics come in groups of 16. These groups contain sprites in the same order as sprites 1275-1290 in trg1<nowiki><nowiki>[r]</nowiki></nowiki>.grf; red, then green, for each of: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing.
 
   
  +
==== 04 Signal graphics. ====
||Group(s)|Contents
 
   
  +
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.
0|lighted entrance signals
 
   
  +
{|
1|lighted exit signals
 
  +
!Group(s)!!Contents
   
  +
|-
2|lighted combo signals
 
  +
|0||lighted entrance signals
   
  +
|-
3|standard (non-pre-signal) semaphore signals
 
  +
|1||lighted exit signals
   
  +
|-
4..6|repeat 0..2 for semaphores
 
  +
|2||lighted combo signals
   
  +
|-
7|standard lighted PBS signals
 
  +
|3||standard (non-pre-signal) semaphore signals
   
  +
|-
8..14|repeat 0..6 for PBS signals||
 
  +
|4..6||repeat 0..2 for semaphores
   
  +
|-
====0C Snowy temperate trees====
 
  +
|7||standard lighted PBS signals
   
  +
|-
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.
 
  +
|8..14||repeat 0..6 for PBS signals
  +
|}
   
====0D Coast tile sprites====
+
==== 09 One-way road arrows ====
   
  +
Overlay sprites to indicate the direction of one-way roads.
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 (1) is as follows:
 
  +
The 6 sprites originally supported from {{ottdp|0.6|2.5}} are, in order:
   
  +
arrow facing SW, arrow NE, impassable NE-SW, arrow NW, arrow SE, impassable NW-SE.
~pp~
 
   
  +
Before {{ottdp|13|no}} these are used on both flat and sloped roads.
3997, 4063, 4064, 4068, 4062, 3998, 4066, 3988,
 
   
  +
From {{ottdp|13|no}} the grf can optionally provide 18 sprites instead of 6.
4065, 4069, 3996, 3992, 4067, 3994, 3995, 3999.
 
  +
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.
   
  +
==== 0C Snowy temperate trees ====
~/pp~
 
   
  +
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.
(1) Sprite numbers from trg1(r).pcx.
 
  +
  +
==== 0D Coast tile sprites ====
  +
  +
===== In NewGRFs =====
  +
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<ref name=numbers>Sprite numbers from trg1(r).pcx.</ref> is as follows:
  +
  +
3997, 4063, 4064, 4068, 4062, 3998, 4066, 3988,
  +
4065, 4069, 3996, 3992, 4067, 3994, 3995, 3999.
  +
  +
<references />
  +
  +
[[File:Action5Coast16Sprites.png]]
   
 
''The 16 sprites for feature 0D''
 
''The 16 sprites for feature 0D''
   
  +
===== In Base Set's extra grf =====
Additionally, OpenTTD (since r11726) supports another method of supplying all additional coast tile sprites, but this is only allowed in the ''extra'' 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 trg1(r).pcx. Note that the 10 sprites version supplies two additional slopes, but they are not used, and are currently unlikely to be ever used.
 
  +
Additionally, OpenTTD (since r11726) supports another method of supplying all additional coast tile sprites, but this is only allowed in the ''extra'' 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.
  +
  +
[[File:Action5Coast10Sprites.png]]
   
 
''Only 10 sprites are required for OpenTTD base graphic sets''
 
''Only 10 sprites are required for OpenTTD base graphic sets''
Line 144: Line 202:
 
''In OpenTTD 10 sprites for type 0D is enough in base graphic sets. The 16 sprites version should not be used for base graphics.''
 
''In OpenTTD 10 sprites for type 0D is enough in base graphic sets. The 16 sprites version should not be used for base graphics.''
   
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 &quot;extra&quot; NewGRF of some Base Graphics Set.
+
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 "extra" NewGRF of some Base Graphics Set.
   
====0E New Signals====
+
==== 0E New Signals ====
   
 
Any number of real and recolour sprites can be specified in the action in any order.
 
Any number of real and recolour sprites can be specified in the action in any order.
Line 152: Line 210:
 
Sprites are referenced by their offset into the action5 block by a [[VarAction2NewSignals]], hence a logically easily calculable order is advised.
 
Sprites are referenced by their offset into the action5 block by a [[VarAction2NewSignals]], hence a logically easily calculable order is advised.
   
As of 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).
+
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).
   
====0F Tracks for Slopes====
+
==== 0F Tracks for Slopes ====
   
 
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).
 
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).
   
(1) Sprite numbers from trg1r.pcx.
+
(1) Sprite numbers from trg1r.pcx / ogfx1_base.grf
   
====11 Road stop graphics====
+
==== 11 Road stop graphics ====
   
 
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.
 
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.
Line 170: Line 228:
 
<pre>\d1313
 
<pre>\d1313
   
\b13 \b0 \b0 \b3 \b16 \b16 &lt;SW sprite&gt;
+
\b13 \b0 \b0 \b3 \b16 \b16 <SW sprite>
   
\b0 \b0 \b0 \b3 \b16 \b16 &lt;NE sprite&gt;
+
\b0 \b0 \b0 \b3 \b16 \b16 <NE sprite>
   
 
80</pre>
 
80</pre>
Line 180: Line 238:
 
<pre>\d1314
 
<pre>\d1314
   
\b0 \b0 \b0 \b16 \b3 \b16 &lt;NW sprite&gt;
+
\b0 \b0 \b0 \b16 \b3 \b16 <NW sprite>
   
\b0 \b13 \b0 \b16 \b3 \b16 &lt;SE sprite&gt;
+
\b0 \b13 \b0 \b16 \b3 \b16 <SE sprite>
   
 
80</pre>
 
80</pre>
   
where 1313 and 1314 are city road sprites.
+
where 1313 and 1314 are town road sprites.
   
  +
[[File:roadstops.png]]
Reference sprites can be found in '''roadstops.grf''' (OpenTTD) or '''ttdpbase(w).grf''' (TTDPatch).
 
  +
  +
Further sprites can be found in '''openttd.grf''' (OpenTTD), '''ogfxe_extra.grf''' (OpenGFX) or '''ttdpbase(w).grf''' (TTDPatch).
   
 
'''Note''': As of OpenTTD r10185, the behaviour of this feature is identical in both games.
 
'''Note''': As of OpenTTD r10185, the behaviour of this feature is identical in both games.
   
====12 Aqueducts====
+
==== 12 Aqueducts ====
   
 
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.
 
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.
   
  +
[[File:aqueduct.png]]
===num-sprites===
 
  +
  +
==== 15 / 95 OpenTTD GUI sprites ====
  +
  +
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:
  +
{|
  +
!Offset !! Meaning
  +
|-
  +
|0 .. 11|| Halftile selections
  +
|-
  +
|12 .. 13 || Title screen letters E and D
  +
|-
  +
|14 .. 37 || Bridge piers colours 1 .. 4
  +
|-
  +
|38 || square indicating NewGRF compatibility
  +
|-
  +
|39 || blob indicating server compatibility
  +
|-
  +
|40 || lock icon
  +
|-
  +
|41 || empty check box
  +
|-
  +
|42 || checked check box
  +
|-
  +
|43 || warning sign
  +
|-
  +
|44 || window resize right
  +
|-
  +
|45 .. 48|| arrows
  +
|-
  +
|49 || house
  +
|-
  +
|50 || shared orders
  +
|-
  +
|51 .. 52 || pin / pinned
  +
|-
  +
|53 .. 62 || rail build icons and cursors
  +
|-
  +
|63 .. 68 || monorail build icons and cursors
  +
|-
  +
|69 .. 74 || maglev build icons and cursors
  +
|-
  +
|75 || ??
  +
|-
  +
|76 .. 77 || waypoint toolbar and cursor icon
  +
|-
  +
|78 .. 81 || waypoint buildings
  +
|-
  +
|82 .. 85 || autoroad toobar and cursor for road and trams
  +
|-
  +
|86 || helipad
  +
|-
  +
|87 || build ship lift cursor
  +
|-
  +
|88 .. 89 || build canal toolbar and cursor
  +
|-
  +
|90 || fast forward
  +
|-
  +
|91 .. 92 || level land toolbar and cursor
  +
|-
  +
|93 .. 96 || sell vehicle
  +
|-
  +
|97 .. 100 || sell all vehicles
  +
|-
  +
|101 .. 104 || replace vehicle
  +
|-
  +
|105 || sell chain of rail vehicles
  +
|-
  +
|106 .. 113 || clone vehicles button and cursors
  +
|-
  +
|114 .. 117 || create vehicle group button
  +
|-
  +
|118 .. 121 || delete vehicle group button
  +
|-
  +
|122 .. 125 || rename vehicle group button
  +
|-
  +
|126 .. 133 || group replace on / off button
  +
|-
  +
|134 || road toolbar: build one-way roads
  +
|-
  +
|135 || signal toolbar: convert signals
  +
|-
  +
|136 .. 137|| build rivers toolbar and cursor
  +
|-
  +
|138 .. 143 || OSK
  +
|-
  +
|144 || switch toolbar
  +
|-
  +
|145 .. 146 || build aqueduct toolbar and cursor
  +
|-
  +
|147 .. 148 || (+) and (-) icon
  +
|-
  +
|149 || window resize left
  +
|-
  +
|150 || play music right-to-left languages
  +
|-
  +
|151 .. 152 || shade / unshade
  +
|-
  +
|153 || debug
  +
|-
  +
|154 .. 157 || vehicle profit icons
  +
|-
  +
|158 || unread news
  +
|-
  +
|159 || exclusive transport rights
  +
|-
  +
|160 || autoreplace protection
  +
|-
  +
|161 || autoreplace defined
  +
|-
  +
|162 .. 165 || Town happiness indicator: N/A, appalling, mediocre and good
  +
|-
  +
|166 .. 167 || Icons for delete to the left resp. right
  +
|-
  +
|168 || Default window size
  +
|-
  +
|169 .. 173 || Story book: Main toolbar icon, goto place, unfinished goal, finished goal, broken goal
  +
|-
  +
|174 || Smallmap cargoflow button
  +
|-
  +
|175 .. 178 || Icons for group livery selection
  +
|-
  +
|179 .. 183 || NotRoadTypes toolbar and cursor icons
  +
|-
  +
|184 || {{ottd|1.11|g8dda0ec4f}} window title bar: rename vehicle/station/town/...
  +
|-
  +
|185 || {{ottd|1.11|g8dda0ec4f}} window title bar: go to location of vehicle/station/town/industry/...
  +
|-
  +
|186 .. 190 || {{ottd|1.12|gfda1a590f6}} multiplayer GUI: chat, admin action, join team, self player, host player
  +
|}
  +
  +
==== 16 / 96 Airport preview sprites ====
  +
[[File:airport_preview_commuter.png|right]]
  +
Preview sprites for the airports in the order
  +
# Small airport
  +
# City airport
  +
# Heliport
  +
# Metropolitan airport
  +
# International airport
  +
# Commuter airport
  +
# Heli depot
  +
# Intercontinental airport
  +
# Heli station
  +
  +
Sprites are without any offsets and should all be the same size. Make sure so by using the forbid cropping.
  +
  +
==== 17 / 97 Tunnel overlay sprites ====
  +
[[File:tunnel_overlays.png|right]]
  +
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).
  +
  +
=== num-sprites ===
   
 
The number of sprites that follow.
 
The number of sprites that follow.
Line 204: Line 414:
 
Note that it is not generally an error to provide more sprites than required, but this does expend sprite slots unnecessarily.
 
Note that it is not generally an error to provide more sprites than required, but this does expend sprite slots unnecessarily.
   
===offset===
+
=== offset ===
   
 
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.
 
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.
Line 210: Line 420:
 
'''Note:''' When creating a TTDPatch compatible grf, you have to skip the OpenTTD specific Action 05'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.
 
'''Note:''' When creating a TTDPatch compatible grf, you have to skip the OpenTTD specific Action 05'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.
   
  +
'''Note:''' 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.
-=Example=-
 
  +
  +
== Example ==
   
  +
<pre>
<span style='color:#808080'>Something to go here</span>
 
  +
// Replace the piers for the aqueduct
  +
1457 * 3 05 12 02 06 // action5, type 12, 2 sprites, at offset 6 into that type
  +
9 sprites/png/terrain/waterfeatures.png 546 8 09 23 33 -26 0
  +
10 sprites/png/terrain/waterfeatures.png 594 8 09 23 33 -5 0
  +
</pre>

Latest revision as of 19:48, 23 April 2024

Introduction

Define base graphics specific sets


Action 5 is used to define graphics for several new features of OpenTTD and TTDPatch. This is similar to action 1.

Syntax

The data looks as follows:

<Sprite-number> * <Length> 05 <type> <num-sprites> [<offset>]
Element Size Description
<Sprite-number> dec A sequential sprite number
<length> dec The total number of bytes used in this action
05 B Defines action 05
<type> B What type of graphics follow
<num-sprites> B* How many regular sprites follow
<offset> B* Offset in the Action 5 assignable block of sprites

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.

Supported by OpenTTD 0.70.7 Supported by TTDPatch 2.5 (alpha 19)2.5Action 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.

Description

Sprite-number

This is just the number you are at.

Length

Count the number of bytes in this action.

type

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:

Type Version Feature num-sprites (decimal)
04 Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 Pre-signal graphics 48
04 Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 Pre-signal and semaphore graphics 112
04,84[1] Supported by OpenTTD Supported by TTDPatch 2.5 (alpha 41)2.5 Pre-signal, semaphore, and PBS graphics 240
05,85[1] Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 Overhead wires and pylon graphics 48
06 Supported by OpenTTD 0.60.6 Supported by TTDPatch Foundations (retaining walls) for BuildOnSlopes 74
06,86[1] Supported by OpenTTD 0.6 (r11321)0.6 Not supported by TTDPatch Foundations for BuildOnSlopes and half tiles (NS and EW foundations) 90
07 Not supported by OpenTTD Supported by TTDPatch 2.5 (alpha 43)2.5 TTDPatch GUI sprites 93 [2]
08,88[1] Supported by OpenTTD 0.60.6 Not supported by TTDPatch[3] Canals 65
09,89[1] Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 58)2.5 One-way road arrows Supported by OpenTTD 1313 Not supported by TTDPatch 18 Supported by OpenTTD 0.6 - 120.6 - 12 Supported by TTDPatch 2.52.5 6
0A,8A[1] Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 67)2.5 Two company color translation maps 256
0B,8B[1] Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 68)2.5 Tram tracks Supported by OpenTTD 1.101.10 Not supported by TTDPatch 119 Supported by OpenTTD 0.6 - 1.90.6 - 1.9 Supported by TTDPatch 2.52.5 113
0C Not supported by OpenTTD Supported by TTDPatch 2.5 (alpha 74)2.5 Snowy temperate trees 133
0D Supported by OpenTTD 0.6 (r7325 (r11726))0.6 Supported by TTDPatch 2.5 (beta 5)2.5 Coast Tile graphics 16 (18)
0E Not supported by OpenTTD Supported by TTDPatch 2.6 (r1247)2.6 New Signals Any
0F,8F[1] Supported by OpenTTD 0.7 (r13469)0.7 Supported by TTDPatch 2.6 (r1487)2.6 Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP) Up to 12
10,90[1] Supported by OpenTTD 0.6 (r9645)0.6 Not supported by TTDPatch Additional airport graphics 15
11,91[1] Supported by OpenTTD 0.6 (r9645)0.6 Supported by TTDPatch 2.6 (r1589)2.6 Road stop graphics 8
12,92[1] Supported by OpenTTD 0.7 (r13464)0.7 Supported by TTDPatch 2.6 (r1498)2.6 Aqueduct graphics 8
13,93[1] Supported by OpenTTD 0.6 (r11433)0.6 Not supported by TTDPatch Autorail sprites 55
14,94 Supported by OpenTTD 0.6 - 1.11 (11433)0.6 - 1.11 Not supported by TTDPatch Flag sprites (no longer used) Up to 36
15,95 Supported by OpenTTD 0.6 (r11433)0.6 Not supported by TTDPatch OpenTTD GUI sprites Up to 191
16,96 Supported by OpenTTD 1.1 (r20370)1.1 Not supported by TTDPatch Airport preview sprites Up to 9
17,97 Supported by OpenTTD 1.2 (r23952)1.2 Not supported by TTDPatch Railtype tunnel base sprites 16
18,98 Supported by OpenTTD 1.5 (r26869)1.5 Not supported by TTDPatch Extra all black palette 1
19,99 Supported by OpenTTD 1515 Not supported by TTDPatch Road waypoint graphics 4
  1. 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 Offset allowed since Supported by OpenTTD 1.2 (r23005)1.2 Not supported by TTDPatch
  2. Type 07 only requires 73 sprites in the stable (2.5 branch); the extra sprites are the clone train and build canal cursors.
  3. 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. The method via Action5 is no longer supported by TTDpatch 2.0.1 alpha 26 and newer.

04 Signal graphics.

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.

Group(s) Contents
0 lighted entrance signals
1 lighted exit signals
2 lighted combo signals
3 standard (non-pre-signal) semaphore signals
4..6 repeat 0..2 for semaphores
7 standard lighted PBS signals
8..14 repeat 0..6 for PBS signals

09 One-way road arrows

Overlay sprites to indicate the direction of one-way roads. The 6 sprites originally supported from Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5 are, in order:

arrow facing SW, arrow NE, impassable NE-SW, arrow NW, arrow SE, impassable NW-SE.

Before Supported by OpenTTD 1313 Not supported by TTDPatch these are used on both flat and sloped roads.

From Supported by OpenTTD 1313 Not supported by TTDPatch the grf can optionally provide 18 sprites instead of 6. 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.

0C Snowy temperate trees

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.

0D Coast tile sprites

In NewGRFs

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[1] is as follows:

3997, 4063, 4064, 4068, 4062, 3998, 4066, 3988,
4065, 4069, 3996, 3992, 4067, 3994, 3995, 3999.
  1. Sprite numbers from trg1(r).pcx.

Action5Coast16Sprites.png

The 16 sprites for feature 0D

In Base Set's extra grf

Additionally, OpenTTD (since r11726) supports another method of supplying all additional coast tile sprites, but this is only allowed in the extra NewGRF of 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.

Action5Coast10Sprites.png

Only 10 sprites are required for OpenTTD base graphic sets

In OpenTTD 10 sprites for type 0D is enough in base graphic sets. The 16 sprites version should not be used for base graphics.

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 "extra" NewGRF of some Base Graphics Set.

0E New Signals

Any number of real and recolour sprites can be specified in the action in any order.

Sprites are referenced by their offset into the action5 block by a VarAction2NewSignals, hence a logically easily calculable order is advised.

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).

0F Tracks for Slopes

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).

(1) Sprite numbers from trg1r.pcx / ogfx1_base.grf

11 Road stop graphics

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.

SW and NE sprites are used with road going along the Y axis ( .\' ), NW and SE with road along the X axis( '/. ).

Internally, the stations are defined using the following station layouts:

\d1313

\b13 \b0 \b0 \b3 \b16 \b16 <SW sprite>

\b0 \b0 \b0 \b3 \b16 \b16 <NE sprite>

80

and

\d1314

\b0 \b0 \b0 \b16 \b3 \b16 <NW sprite>

\b0 \b13 \b0 \b16 \b3 \b16 <SE sprite>

80

where 1313 and 1314 are town road sprites.

Roadstops.png

Further sprites can be found in openttd.grf (OpenTTD), ogfxe_extra.grf (OpenGFX) or ttdpbase(w).grf (TTDPatch).

Note: As of OpenTTD r10185, the behaviour of this feature is identical in both games.

12 Aqueducts

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.

Aqueduct.png

15 / 95 OpenTTD GUI sprites

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:

Offset Meaning
0 .. 11 Halftile selections
12 .. 13 Title screen letters E and D
14 .. 37 Bridge piers colours 1 .. 4
38 square indicating NewGRF compatibility
39 blob indicating server compatibility
40 lock icon
41 empty check box
42 checked check box
43 warning sign
44 window resize right
45 .. 48 arrows
49 house
50 shared orders
51 .. 52 pin / pinned
53 .. 62 rail build icons and cursors
63 .. 68 monorail build icons and cursors
69 .. 74 maglev build icons and cursors
75 ??
76 .. 77 waypoint toolbar and cursor icon
78 .. 81 waypoint buildings
82 .. 85 autoroad toobar and cursor for road and trams
86 helipad
87 build ship lift cursor
88 .. 89 build canal toolbar and cursor
90 fast forward
91 .. 92 level land toolbar and cursor
93 .. 96 sell vehicle
97 .. 100 sell all vehicles
101 .. 104 replace vehicle
105 sell chain of rail vehicles
106 .. 113 clone vehicles button and cursors
114 .. 117 create vehicle group button
118 .. 121 delete vehicle group button
122 .. 125 rename vehicle group button
126 .. 133 group replace on / off button
134 road toolbar: build one-way roads
135 signal toolbar: convert signals
136 .. 137 build rivers toolbar and cursor
138 .. 143 OSK
144 switch toolbar
145 .. 146 build aqueduct toolbar and cursor
147 .. 148 (+) and (-) icon
149 window resize left
150 play music right-to-left languages
151 .. 152 shade / unshade
153 debug
154 .. 157 vehicle profit icons
158 unread news
159 exclusive transport rights
160 autoreplace protection
161 autoreplace defined
162 .. 165 Town happiness indicator: N/A, appalling, mediocre and good
166 .. 167 Icons for delete to the left resp. right
168 Default window size
169 .. 173 Story book: Main toolbar icon, goto place, unfinished goal, finished goal, broken goal
174 Smallmap cargoflow button
175 .. 178 Icons for group livery selection
179 .. 183 NotRoadTypes toolbar and cursor icons
184 Supported by OpenTTD 1.11 (g8dda0ec4f)1.11 window title bar: rename vehicle/station/town/...
185 Supported by OpenTTD 1.11 (g8dda0ec4f)1.11 window title bar: go to location of vehicle/station/town/industry/...
186 .. 190 Supported by OpenTTD 1.12 (gfda1a590f6)1.12 multiplayer GUI: chat, admin action, join team, self player, host player

16 / 96 Airport preview sprites

Airport preview commuter.png

Preview sprites for the airports in the order

  1. Small airport
  2. City airport
  3. Heliport
  4. Metropolitan airport
  5. International airport
  6. Commuter airport
  7. Heli depot
  8. Intercontinental airport
  9. Heli station

Sprites are without any offsets and should all be the same size. Make sure so by using the forbid cropping.

17 / 97 Tunnel overlay sprites

Tunnel overlays.png

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).

num-sprites

The number of sprites that follow.

Since TTDPatch 2.0.1 alpha 49, this value is an extended byte.

Note that it is not generally an error to provide more sprites than required, but this does expend sprite slots unnecessarily.

offset

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.

Note: When creating a TTDPatch compatible grf, you have to skip the OpenTTD specific Action 05'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.

Note: 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.

Example

// Replace the piers for the aqueduct
 1457 * 3        05 12 02 06 // action5, type 12, 2 sprites, at offset 6 into that type
    9 sprites/png/terrain/waterfeatures.png 546 8 09 23 33 -26 0
   10 sprites/png/terrain/waterfeatures.png 594 8 09 23 33 -5 0