Action2/Single Set

From GRFSpecs
< Action2
Revision as of 19:31, 5 August 2010 by Yexo (talk | contribs)
Jump to navigationJump to search

Defining cargo IDs for cargos

Action 2

Defining cargo IDs for cargos, railtypes and airports.

-=Introduction=-

The only graphics associated to cargos is their icon that is shown in the station window, therefore the action 2 you need isn't too complicated.

The graphics associated with railtypes are somewhat more complicated, but all their logic is in variational action 2s and the action 3; the standard 2 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'll probably look best if you make sure it's no larger than the default size.

-=Format=-

-+<Sprite-number> * <Length> 02 0B/10 <cargo-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 action 02

0B/10|B|Sprites are used for feature 0B - cargos, or feature 10 - rail types

<cargo-id>|B|What cargo ID this action 2 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 action 2 entry for vehicles, but with num_loadtypes=1 and num_loadingtypes=0, and only one set number.

-=Filling in the terms=-

Sprite-number

This is just the number you are at.

Length

Count the number of bytes in this action.

Set

A WORD value, the number of the spriteset to be used. (Don't forget that sprite set numbering starts from zero)