Difference between revisions of "Action5"
(add images from old wiki) |
Planetmaker (talk | contribs) (Add version information in a nice way) |
||
Line 2: | Line 2: | ||
− | Define |
+ | Define base graphics specific sets |
− | Action 5 is used to define graphics for several new features of TTDPatch. This is similar to action 1. |
+ | Action 5 is used to define graphics for several new features of OpenTTD and TTDPatch. This is similar to action 1. |
== Syntax == |
== Syntax == |
||
Line 37: | Line 37: | ||
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 GRFID (not FFFFFFFF) will always override those from .grf files with a GRFID of FFFFFFFF |
+ | {{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 == |
== Description == |
||
Line 54: | Line 54: | ||
{| |
{| |
||
− | !Type!!Feature!!num-sprites (decimal) |
+ | !Type!!Version!!Feature!!num-sprites (decimal) |
|- |
|- |
||
− | |04||Pre-signal graphics||48 |
+ | |04||{{ottdp| | }}||Pre-signal graphics||48 |
|- |
|- |
||
− | |04||Pre-signal and semaphore graphics||112 |
+ | |04||{{ottdp| | }}||Pre-signal and semaphore graphics||112 |
|- |
|- |
||
− | |04||Pre-signal, semaphore, and [[PathBasedSignalling|PBS]] graphics||240 |
+ | |04||{{ottdp| |2.5|ttdprev=alpha 41}}||Pre-signal, semaphore, and [[PathBasedSignalling|PBS]] graphics||240 |
|- |
|- |
||
− | |05||Overhead wires and pylon graphics||48 |
+ | |05||{{ottdp| | }}||Overhead wires and pylon graphics||48 |
|- |
|- |
||
− | |06||Foundations (retaining walls) for BuildOnSlopes ||74 |
+ | |06||{{ottdp| | }}||Foundations (retaining walls) for BuildOnSlopes ||74 |
|- |
|- |
||
− | |06||Foundations for BuildOnSlopes and half tiles (NS and EW foundations) ||90 |
+ | |06||{{ottdp|0.6| |ottdrev=r11321}}||Foundations for BuildOnSlopes and half tiles (NS and EW foundations) ||90 |
|- |
|- |
||
− | |07 |
+ | |07||{{ottdp|no|2.5|ttdprev=alpha 43}}||TTDPatch GUI sprites||93 (a) |
|- |
|- |
||
− | |08|| |
+ | |08||{{ottdp| |2.5|ttdprev=alpha 17}}||Canals||65 |
|- |
|- |
||
− | |09||One-way road arrows||6 |
+ | |09||{{ottdp| |2.5|ttdprev=alpha 58}}||One-way road arrows||6 |
|- |
|- |
||
− | |0A||Two company color translation maps||256 |
+ | |0A||{{ottdp| |2.5|ttdprev=alpha 67}}||Two company color translation maps||256 |
|- |
|- |
||
− | |0B|| |
+ | |0B||{{ottdp| |2.5|ttdprev=alpha 68}}||Tram tracks||113 |
|- |
|- |
||
− | |0C||Snowy temperate trees||133 |
+ | |0C||{{ottdp| |2.5|ttdprev=alpha 74}}||Snowy temperate trees||133 |
|- |
|- |
||
+ | |0D||{{ottdp|0.6|2.5|ottdrev=r7325 (r11726)|ttdprev=beta 5}}||Coast Tile graphics||16 (18) |
||
− | |0D||Coast Tile graphics||16 (18)||2.5 beta 5, OpenTTD r7325 (OpenTTD r11726) |
||
|- |
|- |
||
− | |0E|| |
+ | |0E||{{ottdp| |2.6|ttdprev=r1247}}||New Signals||Any |
|- |
|- |
||
− | |0F||Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP)||12 |
+ | |0F||{{ottdp|0.7|2.6|ottdrev=r13469|ttdprev=r1487}}||Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP)||12 |
|- |
|- |
||
− | |10||Additional airport graphics||15 |
+ | |10||{{ottdp|0.6|no|ottdrev=r9645}}||Additional airport graphics||15 |
|- |
|- |
||
− | |11||Road stop graphics||8 |
+ | |11||{{ottdp|0.6|2.6|ottdrev=r9645|ttdprev=r1589}}||Road stop graphics||8 |
|- |
|- |
||
+ | |12||{{ottdp|0.7|2.6|ottdrev=r13464|ttdprev=r1498}}||Aqueduct graphics||8 |
||
− | |12||Aqueduct graphics||8||2.6 alpha 0 r1498, OpenTTD r13464 |
||
|- |
|- |
||
− | |13||Autorail sprites||55 |
+ | |13||{{ottdp|0.6|no|ottdrev=r11433}}||Autorail sprites||55 |
|- |
|- |
||
− | |14,94||Flag sprites||Up to 36 |
+ | |14,94||{{ottdp|0.6|no|ottdrev=11433}}||Flag sprites||Up to 36 |
|- |
|- |
||
− | |15,95||OpenTTD GUI sprites||Up to 160 |
+ | |15,95||{{ottdp|0.6|no|ottdrev=r11433}}||OpenTTD GUI sprites||Up to 160 |
|- |
|- |
||
− | |16,96||Airport preview sprites||Up to 9 |
+ | |16,96||{{ottdp|1.1|no|ottdrev=r20370}}||Airport preview sprites||Up to 9 |
|} |
|} |
||
Line 193: | Line 193: | ||
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 ==== |
||
Line 223: | Line 223: | ||
where 1313 and 1314 are town road sprites. |
where 1313 and 1314 are town road sprites. |
||
− | Reference sprites can be found in ''' |
+ | Reference 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. |
Revision as of 13:40, 23 July 2011
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.
0.7 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 | Pre-signal graphics | 48 | |
04 | Pre-signal and semaphore graphics | 112 | |
04 | 2.5 | Pre-signal, semaphore, and PBS graphics | 240 |
05 | Overhead wires and pylon graphics | 48 | |
06 | Foundations (retaining walls) for BuildOnSlopes | 74 | |
06 | 0.6 | Foundations for BuildOnSlopes and half tiles (NS and EW foundations) | 90 |
07 | 2.5 | TTDPatch GUI sprites | 93 (a) |
08 | 2.5 | Canals | 65 |
09 | 2.5 | One-way road arrows | 6 |
0A | 2.5 | Two company color translation maps | 256 |
0B | 2.5 | Tram tracks | 113 |
0C | 2.5 | Snowy temperate trees | 133 |
0D | 0.6 2.5 | Coast Tile graphics | 16 (18) |
0E | 2.6 | New Signals | Any |
0F | 0.7 2.6 | Sprites for marking tracks on slopes (for track reservation systems like PBS or YAPP) | 12 |
10 | 0.6 | Additional airport graphics | 15 |
11 | 0.6 2.6 | Road stop graphics | 8 |
12 | 0.7 2.6 | Aqueduct graphics | 8 |
13 | 0.6 | Autorail sprites | 55 |
14,94 | 0.6 | Flag sprites | Up to 36 |
15,95 | 0.6 | OpenTTD GUI sprites | Up to 160 |
16,96 | 1.1 | Airport preview sprites | Up to 9 |
(a) Type 07 only requires 73 sprites in the stable (2.5 branch); the extra sprites are the clone train and build canal cursors.
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 |
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
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.
The 16 sprites for feature 0D
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 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.
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.
Reference 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.
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.
Example
Something to go here