Difference between revisions of "Action2/Single Set"
(merge canals page) |
m (moved Action2Cargos to Action2/Single Set: use subpages) |
(No difference)
|
Revision as of 21:13, 17 June 2011
Introduction
Feature | TTDPatch | OpenTTD | Associated graphics |
---|---|---|---|
Canals | ? | 0.6 | Depends on Action3 ID; see Action0 |
Cargos | ? | 0.6 | Single icon sprite |
Airports | not supported | 1.1.0 | Single preview image |
Railtypes | not supported | 1.0.0 (r19056) | Depends on Action3 'cargo' type |
The Action2 for these features defines only a single spriteset, therefore the action2 you need isn't too complicated.
The only graphics associated to cargoes is their icon that is shown in the station window.
The graphics associated with railtypes are somewhat more complicated, but all their logic is in variational action2s and the action3; the standard action2 is again not complicated.
The only graphics associated with airports is their preview sprite. The default size for the preview sprite is 230x140. The airport build GUI will automatically scale if you have a smaller or larger image, but it will probably look best if you make sure it is no larger than the default size.
Syntax
<Sprite-number> * <Length> 02 0B/10 <set-id> 01 00 <set>
Element | Size | Description |
---|---|---|
<Sprite-number> | dec | A sequential sprite number |
<length> | dec | The total number of bytes used in this action |
02 | B | Defines action2 |
0B/10 | B | Sprites are used for feature 0B - cargoes, or feature 10 - rail types |
<set-id> | B | What set-ID this action2 defines |
01 | B | A literal 01 byte |
00 | B | A literal 00 byte |
<set> | W | Number of set to use from the last action 1 |
You may note that this is the same as the action2 entry for vehicles, but with num_loadtypes=1 and num_loadingtypes=0, and only one set number.
Description
Sprite-number
This is just the number you are at.
Length
Count the number of bytes in this action.
set-id
This defines the ID of the current action 2. This ID will later be referred to by action 3, or a variational/random action 2.
You can reuse action 2 IDs, and there's no restriction on the order in which they are defined.
set
The sprite set to use for displaying. Entry is a WORD value in little endian format, and refers to the most recent action1 set. For example, action1 set 3 would be encoded as 03 00. Note the additional 00 which is needed because it must be a word value here. (Don't forget that sprite set numbering starts from zero)
Notes
Do not skip an action2 using action9 (unless it skips the whole file). Action2 must not be skipped by action9 or TTDPatch will most likely crash. Skip or modify action3 instead. Skipping an action2 with an action7 has no effect.