Difference between revisions of "Action2/Stations"
m (Bot: Automated text replacement (--= +==)) |
(Undo revision 2882; spritelayouts for stations are done via Action0) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
== Introduction == |
== Introduction == |
||
− | |||
Defining station set-IDs. |
Defining station set-IDs. |
||
⚫ | |||
⚫ | |||
⚫ | |||
− | ==Syntax== |
+ | == Syntax == |
For stations, the data looks as follows: |
For stations, the data looks as follows: |
||
Line 18: | Line 17: | ||
|- |
|- |
||
− | |<Sprite-number>||dec||A sequential sprite number |
+ | |<[[#Sprite-number|Sprite-number]]>||dec||A sequential sprite number |
|- |
|- |
||
− | |<length>||dec||The total number of bytes used in this action |
+ | |<[[#Length|length]]>||dec||The total number of bytes used in this action |
|- |
|- |
||
Line 30: | Line 29: | ||
|- |
|- |
||
− | |<set-id>||B||What set-ID this action2 defines |
+ | |<[[#Set-id|set-id]]>||B||What set-ID this action2 defines |
|- |
|- |
||
− | |<numlittlesets>||B||How many different cargo amounts to show when there is little cargo |
+ | |<[[#numlittlesets, numlotssets|numlittlesets]]>||B||How many different cargo amounts to show when there is little cargo |
|- |
|- |
||
− | |<numlotssets>||B||Same but when there is lots of cargo |
+ | |<[[#numlittlesets, numlotssets|numlotssets]]>||B||Same but when there is lots of cargo |
|- |
|- |
||
− | |<sets...>||W||Sprite sets for each of the cargo amounts |
+ | |<[[#sets|sets]]...>||W||Sprite sets for each of the cargo amounts |
|} |
|} |
||
− | ==Description== |
+ | == Description == |
− | ===Sprite-number=== |
+ | === Sprite-number === |
This is just the number you are at. |
This is just the number you are at. |
||
− | ===Length=== |
+ | === Length === |
Count the number of bytes in this action. |
Count the number of bytes in this action. |
||
− | ===Set-id=== |
+ | === 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). |
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=== |
+ | === numlittlesets, numlotssets === |
− | Like for vehicles, this decides the graphics set to use depending on the amount of cargo waiting. |
+ | 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 first issue, the amount of cargo this refers to depends on the action3 that triggered this action2: |
||
Line 65: | Line 64: | ||
* if the station is displayed for construction, the maximum amount is shown |
* if the station is displayed for construction, the maximum amount is shown |
||
− | Regarding the second issue, TTDPatch introduces the distinction between "little" and "lots of" cargo. |
+ | 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=== |
+ | === 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. |
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. |
||
− | == |
+ | == Example == |
− | |||
⚫ | |||
− | |||
− | ==Example== |
||
<span style='color:#808080'>Something to go here</span> |
<span style='color:#808080'>Something to go here</span> |
Latest revision as of 19:21, 30 November 2011
Introduction
Defining station set-IDs.
For stations, Action2 is used to define set-IDs, similar to the way it works for vehicles. See the description below for details.
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
For stations, the data looks as follows:
<Sprite-number> * <Length> 02 04 <set-id> <numlittlesets> <numlotssets> <sets...>
Element | Size | Description |
---|---|---|
<Sprite-number> | dec | A sequential sprite number |
<length> | dec | The total number of bytes used in this action |
02 | B | Defines action2 |
04 | B | Stations is feature 4 |
<set-id> | B | What set-ID this action2 defines |
<numlittlesets> | B | How many different cargo amounts to show when there is little cargo |
<numlotssets> | B | Same but when there is lots of cargo |
<sets...> | W | Sprite 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:
- if the cargo type matched exactly, it's the amount of the matching cargo (e.g. the action3 said "for coal, use this action2")
- if the default was used, it's the amount of all cargo types added together
- if the station is displayed for construction, the maximum amount is shown
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.
Example
Something to go here