The nfo/grf Technical Reference

Action 2 for stations

Defining set-IDs for stations


Introduction

For stations, action 2 is used to define set-IDs, similar to the way it works for vehicles.

Format

For stations, the data looks as follows:

<sprite-number> * <length> 02 04 <set-id> <numlittlesets> <numlotssets> <sets...>

ElementSizeDescription
<sprite-number>decA sequential sprite number
<length>decThe total number of bytes used in this action
02BDefines action2
04BStations is feature 4
<set-id>BWhat set-ID this action2 defines
<numlittlesets>BHow many different cargo amounts to show when there is little cargo
<numlotssets>BSame but when there is lots of cargo
<sets...>WSprite sets for each of the cargo amounts


Description

<sprite-number>


This is just the number you are at.

<length>


Count the number of bytes in this action.

<set-id>


The set-ID that you want to define for this set. You can choose any value between 00 and FF, and you can reuse them within a grf file at a later point (if being equal to an existing set ID, the existing one is overwritten and the new one is used).

<numlittlesets, numlotssets>


Like for vehicles, this decides the graphics set to use depending on the amount of cargo waiting. There are two caveats, though. Firstly, a station can have 12 different cargoes waiting, not just a single one. Secondly, the maximum amount is 4095 for all stations and all cargo types.

Regarding the first issue, the amount of cargo this refers to depends on the action3 that triggered this action2:


Regarding the second issue, TTDPatch introduces the distinction between "little" and "lots of" cargo. The amount where this occurs is set by property 10, which is zero by default. But if set to a non-zero value, for example 200, then the range 0 to 199 is divided by numlittlesets, and the remaining range 200 to 4095 is divided by numlotssets. If property 10 is zero, the "little" sets are never used, and so numlittlesets may be zero. numlotssets must never be zero, however.

<sets>


The sets from the most recent action1 to use for this set-ID, for each stage of numlittlesets and numlotssets, i.e. in total numlittlesets+numlotssets entries.


Note

Do not skip an action 2 using either action 7 or action 9 (unless those skip the whole file). Action 2 must not be skipped or TTDPatch will most likely crash. Skip or modify action 3 instead.


Example

Something to go here