The nfo/grf Technical Reference

Action 2 for Canals and Rivers

Defining set-IDs for canals and rivers


Introduction

For feature 5 (canals and rivers), action2 is used to define simple graphic mappings.


Format

For canals and rivers, the data looks as follows:

<sprite-number> * <length> 02 <set-id> 01 00 <set>

ElementSizeDescription
<sprite-number>decA sequential sprite number
<length>decThe total number of bytes used in this action
02BDefines action2
05BFeature: Canals/Rivers
<set-id>BWhat set-ID this action 2 defines
01B
00B
<set>WNumber of set to use from the last action1.


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 to be used in Action3 default set-id. You may choose any value between 00 and FF, and you may reuse them within a grf file at a later point.

<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.


Note

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.