The nfo/grf Technical Reference

Action A

Modifying original TTD sprites


Introduction

Unlike actions 1 and 5, which add new sprites for new features or vehicles, action A modifies TTD's built-in sprites.


Format

The data looks as follows:

<sprite-number> * <length> 0A <num-sets> <num-sprites> <first-sprite>...

ElementSizeDescription
<sprite-number>decA sequential sprite number
<length>decThe total number of bytes used in this action
0ABDefines action 0A
<num-sets>BHow many sets of sprites to replace
<num-sprites>BHow many consecutive sprites in this set
<first-sprite>WNumber of first sprite in this set

The set of <num-sprites> and <first-sprite> is repeated as often as <num-sets> specifies.

The following sprites will be RealSprites or RecolorSprites that replace the given TTD sprites. There must be as many of them as num-sprites of all sets added up.


Description

<sprite-number>


This is just the number you are at.

<length>


Count the number of bytes in this action.

<num-sets>


This sets how many different sets of sprites to replace. Each set are a number of consecutive sprites.

<num-sprites>


How many consecutive sprites to replace in this particular set.

<first-sprite>


The first sprite number to replace in this set.


Notes

Example

Below is an example of what a real Action A pseudo-sprite could look like with the sprite entries under it.

3 * 5 0A 01 0C 3A 08
4 c:\ttd\sprites\farmset.pcx 66 8 09 31 64 -31 0
5 c:\ttd\sprites\farmset.pcx 146 8 09 31 64 -31 0
6 c:\ttd\sprites\farmset.pcx 226 8 09 45 48 -15 -11
7 c:\ttd\sprites\farmset.pcx 290 8 09 33 22 1 -10
8 c:\ttd\sprites\farmset.pcx 322 8 09 31 64 -31 0
9 c:\ttd\sprites\farmset.pcx 402 8 09 29 57 -26 -4
10 c:\ttd\sprites\farmset.pcx 466 8 09 31 64 -31 0
11 c:\ttd\sprites\farmset.pcx 546 8 09 31 39 -19 -6
12 c:\ttd\sprites\farmset.pcx 594 8 09 31 64 -31 0
13 c:\ttd\sprites\farmset.pcx 674 8 09 49 28 -6 -28
14 c:\ttd\sprites\farmset.pcx 722 8 09 31 64 -31 0
15 c:\ttd\sprites\farmset.pcx 2 72 09 30 55 -29 0


ByteMeaning
3<sprite-number>
5<length> of the action in bytes; start counting at 0A (<action>)
0A<action>: sets this pseudo-sprite to function as action A
01<num-sets>: sets it to 1 set to replace
0C<num-sprites>: sets it to 12 sprites in this set.
3A 08<first-sprite>: First Sprite of the set (3A 08 - Farms)