Difference between revisions of "Action2"

From GRFSpecs
Jump to navigationJump to search
m (Beautify wiki markup)
(→‎feature: put all features in a table)
Line 45: Line 45:
 
This sets the type of feature that you wish to change. Set it to:
 
This sets the type of feature that you wish to change. Set it to:
   
  +
{|
00 for trains
 
  +
!Value!!Feature
 
  +
|-
01 for road vehicles
 
 
|00 || trains
 
  +
|-
02 for ships
 
 
|01 || road vehicles
 
  +
|-
03 for planes
 
 
|02 || ships
 
  +
|-
04 for stations
 
 
|03 || planes
 
  +
|-
05 for canals/rivers
 
 
|04 || stations
 
  +
|-
06 for bridges
 
 
|05 || canals/rivers
 
  +
|-
07 for houses
 
 
|06 || bridges
 
  +
|-
09 for industry tiles
 
 
|07 || houses
 
  +
|-
0A for industries
 
 
|09 || industry tiles
 
  +
|-
0B for cargos
 
 
|0A || industries
 
  +
|-
0F for objects
 
 
|0B || cargos
 
  +
|-
10 for rail types (since OpenTTD r19056)
 
  +
|0D || airports (OpenTTD r19204)
  +
|-
 
|0F || objects
  +
|-
 
|10 || rail types (OpenTTD r19056)
  +
|-
  +
|11 || airport tiles (OpenTTD r19204)
  +
|}
   
 
=== set-id ===
 
=== set-id ===

Revision as of 15:04, 18 June 2011

Introduction

Defining graphics set IDs.

Action 2 is used to group sets of sprites from the previous action 1 together, and make them accessible by a variational or random action2 (chain) or an action3.

Syntax

In general, the data looks as follows:

<Sprite-number> * <Length> 02 <feature> <set-id> <num-ent1> <num-ent2> <entries...>
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
<feature> B For what type of feature should the following sprites be used?
<set-id> B What set-ID this action 2 defines
<num-ent1> B First number of entries, depends on feature
<num-ent2> B Second number of entries, depends on feature
<entries...> W Entry numbers, depends on the feature

Descriptions

Sprite-number

This is just the number you are at.

Length

Count the number of bytes in this action.

feature

This sets the type of feature that you wish to change. Set it to:

Value Feature
00 trains
01 road vehicles
02 ships
03 planes
04 stations
05 canals/rivers
06 bridges
07 houses
09 industry tiles
0A industries
0B cargos
0D airports (OpenTTD r19204)
0F objects
10 rail types (OpenTTD r19056)
11 airport tiles (OpenTTD r19204)

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.

num-ent1, num-ent2

Each feature has two different graphics ranges, but their exact meaning differs from feature to feature. For example, for vehicles, the first set is used while moving, and the second while loading/unloading in a station.

entries

This is the list of action 1 sets to use, first num-ent1 for the first range, then num-ent2 entries for the second range.

Notes

Do not skip an action 2 using action 9 (unless it skips the whole file). Action 2 must not be skipped by action 9 or the patch will most likely crash. Skip or modify action 3 instead. Skipping an action 2 with an action 7 has no effect.

Feature specific formats

Some features and/or num-ent1 values have a special format. These are detailed on their separate pages (see main menu)

Example