Difference between revisions of "Action2"
(→feature: put all features in a table) |
m (Add road stops to feature table) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
Defining graphics set IDs. |
Defining graphics set IDs. |
||
− | + | Action2 is used to group sets of sprites from the previous [[Action1]] together, and make them accessible by a [[VariationalAction2|variational]] or [[RandomAction2|random action 2]] (chain) or an [[Action3]]. |
|
+ | |||
⚫ | |||
== Syntax == |
== Syntax == |
||
− | In general, the data looks as follows |
+ | In general, the data looks as follows. Some features use a different syntax though (see table below). |
<Sprite-number> * <Length> 02 <feature> <set-id> <num-ent1> <num-ent2> <entries...> |
<Sprite-number> * <Length> 02 <feature> <set-id> <num-ent1> <num-ent2> <entries...> |
||
Line 41: | Line 43: | ||
Count the number of bytes in this action. |
Count the number of bytes in this action. |
||
− | === |
+ | === Feature === |
− | This sets the type of feature that you wish to change. Set it to: |
+ | This sets the type of [[Features|feature]] that you wish to change. Set it to: |
− | {| |
+ | {|- | |
− | !Value!!Feature |
+ | !Value!![[Features|Feature]] |
|- |
|- |
||
+ | |00||[[Action2/Vehicles | Trains]] |
||
− | |00 || trains |
||
|- |
|- |
||
+ | |01||[[Action2/Vehicles | Road Vehicles]] |
||
− | |01 || road vehicles |
||
|- |
|- |
||
+ | |02||[[Action2/Vehicles | Ships]] |
||
− | |02 || ships |
||
|- |
|- |
||
+ | |03||[[Action2/Vehicles | Aircraft]] |
||
− | |03 || planes |
||
|- |
|- |
||
+ | |04||[[Action2/Stations | Stations]] |
||
− | |04 || stations |
||
|- |
|- |
||
+ | |05||[[Action2/Single_Set | Canals/Rivers]] |
||
− | |05 || canals/rivers |
||
|- |
|- |
||
+ | |07||[[Action2/Sprite_Layout | Houses]] (special Sprite Layout format) |
||
− | |06 || bridges |
||
|- |
|- |
||
+ | |09||[[Action2/Sprite_Layout | Industry Tiles]] (special Sprite Layout format) |
||
− | |07 || houses |
||
|- |
|- |
||
+ | |0A||[[Action2/Industries | Industries]] (special Production Callback format) |
||
− | |09 || industry tiles |
||
|- |
|- |
||
+ | |0B||[[Action2/Single_Set | Cargos]] |
||
− | |0A || industries |
||
|- |
|- |
||
+ | |0C||[[Action2/Only_Callback_Failure | Sound Effects]] (callback failure only) |
||
− | |0B || cargos |
||
|- |
|- |
||
+ | |0D||[[Action2/Single_Set | Airports]] |
||
− | |0D || airports (OpenTTD r19204) |
||
|- |
|- |
||
+ | |0E||[[Action2/Only_Callback_Failure | Signals]] (callback failure only) |
||
− | |0F || objects |
||
|- |
|- |
||
+ | |0F||[[Action2/Sprite_Layout | Objects]] (special Sprite Layout format) |
||
− | |10 || rail types (OpenTTD r19056) |
||
|- |
|- |
||
+ | |10||[[Action2/Single_Set | Railtypes]] |
||
− | |11 || airport tiles (OpenTTD r19204) |
||
+ | |- |
||
+ | |11||[[Action2/Sprite_Layout | Airport Tiles]] (special Sprite Layout format) |
||
+ | |- |
||
+ | |12||[[Action2/Single_Set | Roadtypes]] |
||
+ | |- |
||
+ | |13||[[Action2/Single_Set | Tramtypes]] |
||
+ | |- |
||
+ | |14||[[Action2/Sprite_Layout | Road Stops]] (special Sprite Layout format) |
||
|} |
|} |
||
Line 92: | Line 102: | ||
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. |
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 === |
||
− | |||
⚫ | |||
− | |||
− | === 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== |
==Example== |
Latest revision as of 09:52, 11 June 2023
Introduction
Defining graphics set IDs.
Action2 is used to group sets of sprites from the previous Action1 together, and make them accessible by a variational or random action 2 (chain) or an Action3.
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.
Syntax
In general, the data looks as follows. Some features use a different syntax though (see table below).
<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 | Aircraft |
04 | Stations |
05 | Canals/Rivers |
07 | Houses (special Sprite Layout format) |
09 | Industry Tiles (special Sprite Layout format) |
0A | Industries (special Production Callback format) |
0B | Cargos |
0C | Sound Effects (callback failure only) |
0D | Airports |
0E | Signals (callback failure only) |
0F | Objects (special Sprite Layout format) |
10 | Railtypes |
11 | Airport Tiles (special Sprite Layout format) |
12 | Roadtypes |
13 | Tramtypes |
14 | Road Stops (special Sprite Layout format) |
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.