Difference between revisions of "Action0/Airports"
m (2 revisions) |
Planetmaker (talk | contribs) (fix style and formatting) |
||
Line 1: | Line 1: | ||
+ | == Introduction == |
||
− | '''''Action 0 properties for airports''''' |
||
− | |||
− | =Action 0 - Properties for airports= |
||
Defining properties of airports |
Defining properties of airports |
||
− | {maketoc} |
||
Airports work similarly to industries and town buildings. The maximum number of possible airports is 128. All (even overridden) original types count towards this limit. |
Airports work similarly to industries and town buildings. The maximum number of possible airports is 128. All (even overridden) original types count towards this limit. |
||
Line 12: | Line 9: | ||
Defining airports follows the same schema as industries do: to start using an ID, you first need to define it by setting property 8 or 9 for it. If you try to reference an ID (either via action0 or via action3) that isn't defined, your request is ignored, but not reported as an error, either. This means that if you want to conditionally define an ID, all you need to do is skipping the action0 that sets property8/property9, and everything else gets skipped automatically. |
Defining airports follows the same schema as industries do: to start using an ID, you first need to define it by setting property 8 or 9 for it. If you try to reference an ID (either via action0 or via action3) that isn't defined, your request is ignored, but not reported as an error, either. This means that if you want to conditionally define an ID, all you need to do is skipping the action0 that sets property8/property9, and everything else gets skipped automatically. |
||
− | + | ==Properties== |
|
+ | {| |- |
||
− | + | !Number!!Version!!Size!!Description |
|
− | |||
+ | |- |
||
− | 08|(a)|B|Airport type override |
+ | |08||(a)||B||Airport type override |
− | |||
+ | |- |
||
− | 0A|(b)|V|Set airport layout(s) |
+ | |0A||(b)||V||Set airport layout(s) |
− | |||
+ | |- |
||
− | 0C|(a)|2*W|Availability years |
+ | |0C||(a)||2*W||Availability years |
− | |||
+ | |- |
||
− | 0D|(a)|B|Best compatible TTDPatch airport type |
+ | |0D||(a)||B||Best compatible TTDPatch airport type |
− | |||
+ | |- |
||
− | 0E|(a)|B|Catchment area |
+ | |0E||(a)||B||Catchment area |
− | |||
+ | |- |
||
− | 0F|(a)|B|Noise level |
+ | |0F||(a)||B||Noise level |
− | |||
+ | |- |
||
− | 10|(a)|W|TextID to be used as airport name |
+ | |10||(a)||W||TextID to be used as airport name |
+ | |} |
||
(a) Available since OpenTTD r19459 |
(a) Available since OpenTTD r19459 |
||
Line 34: | Line 33: | ||
(b) Available since OpenTTD r20377 |
(b) Available since OpenTTD r20377 |
||
+ | ==Descriptions== |
||
− | -=Comments=- |
||
− | ==Airport type override (08)== |
+ | ===Airport type override (08)=== |
Works as both substitute type and override. The assignment of this property copies all properties of the old type to this new type. List of valid types: [[AirportTypes]] |
Works as both substitute type and override. The assignment of this property copies all properties of the old type to this new type. List of valid types: [[AirportTypes]] |
||
Line 42: | Line 41: | ||
There's a special use of this property: if you set it to FFh, you can disable an original airport. In this case, the ID used must be the number of airport you want to disable. Disable requests are ignored for airports that have already been overridden. |
There's a special use of this property: if you set it to FFh, you can disable an original airport. In this case, the ID used must be the number of airport you want to disable. Disable requests are ignored for airports that have already been overridden. |
||
− | ==Set airportlayout(s) (0A)== |
+ | ===Set airportlayout(s) (0A)=== |
Format of airport layout tables: |
Format of airport layout tables: |
||
+ | {| |- |
||
− | + | !Size!!Variable!!Meaning |
|
− | |||
+ | |- |
||
− | B|numlayouts|The total number of layouts following |
+ | |B||numlayouts||The total number of layouts following |
− | |||
+ | |- |
||
− | D|size|The size in bytes of the whole definition, excluding numlayouts and size |
+ | |D||size||The size in bytes of the whole definition, excluding numlayouts and size |
− | |||
+ | |- |
||
− | V|layouts|numlayout layouts, see format below |
+ | |V||layouts||numlayout layouts, see format below |
+ | |} |
||
Format of an airport layout: |
Format of an airport layout: |
||
+ | {| |- |
||
− | + | !Size!!Variable!!Meaning |
|
− | |||
+ | |- |
||
− | B|xoffs |
+ | |B||xoffs |
− | |||
+ | |- |
||
− | B|yoffs|Offsets counted from the northernmost tile of the airport, specifying the position of the current tile. Both are taken as signed integers, but cannot go negative except the special case mentioned below. |
+ | |B||yoffs||Offsets counted from the northernmost tile of the airport, specifying the position of the current tile. Both are taken as signed integers, but cannot go negative except the special case mentioned below. |
− | |||
+ | |- |
||
− | B|oldtile|An old tile type to be put on the given tile |
+ | |B||oldtile||An old tile type to be put on the given tile |
− | |||
− | |- |
+ | |- |
+ | |||--or--|| |
||
− | |||
+ | |- |
||
− | 0xFE,W|newtile|The ID of an already defined airport tile, padded with 0 to create a word value. This tile type will be placed on the given tile. |
+ | |0xFE,W||newtile||The ID of an already defined airport tile, padded with 0 to create a word value. This tile type will be placed on the given tile. |
− | |||
− | |- |
+ | |- |
+ | |||--or--|| |
||
− | |||
+ | |- |
||
− | 0xFF| |The given tile is checked for clearance, but nothing will be placed on it. Useful to ensure some free space around your airport. This is the only case where xoffs and yoffs can be negative. If xoffs is negative, yoffs must be one lower than the wanted value. |
+ | |0xFF|| ||The given tile is checked for clearance, but nothing will be placed on it. Useful to ensure some free space around your airport. This is the only case where xoffs and yoffs can be negative. If xoffs is negative, yoffs must be one lower than the wanted value. |
+ | |} |
||
The layout consists of a single byte giving the rotation of the layout (0: north, 2: east, 4: south, 6: west) followed by a list of the above tile definitions, terminated by two bytes: 0,80h |
The layout consists of a single byte giving the rotation of the layout (0: north, 2: east, 4: south, 6: west) followed by a list of the above tile definitions, terminated by two bytes: 0,80h |
||
− | ==Availability years (0C)== |
+ | ===Availability years (0C)=== |
First year and last year the airport is available. 0 and FFFF respectively are forever. |
First year and last year the airport is available. 0 and FFFF respectively are forever. |
||
− | ==Best compatible TTDPatch airport type (0D)== |
+ | ===Best compatible TTDPatch airport type (0D)=== |
Used for compatibility with vehicle var 44. Valid values: |
Used for compatibility with vehicle var 44. Valid values: |
||
Line 89: | Line 92: | ||
3: oilrig |
3: oilrig |
||
+ | |||
+ | == Example == |
Revision as of 10:53, 14 June 2011
Introduction
Defining properties of airports
Airports work similarly to industries and town buildings. The maximum number of possible airports is 128. All (even overridden) original types count towards this limit.
Defining airports follows the same schema as industries do: to start using an ID, you first need to define it by setting property 8 or 9 for it. If you try to reference an ID (either via action0 or via action3) that isn't defined, your request is ignored, but not reported as an error, either. This means that if you want to conditionally define an ID, all you need to do is skipping the action0 that sets property8/property9, and everything else gets skipped automatically.
Properties
Number | Version | Size | Description |
---|---|---|---|
08 | (a) | B | Airport type override |
0A | (b) | V | Set airport layout(s) |
0C | (a) | 2*W | Availability years |
0D | (a) | B | Best compatible TTDPatch airport type |
0E | (a) | B | Catchment area |
0F | (a) | B | Noise level |
10 | (a) | W | TextID to be used as airport name |
(a) Available since OpenTTD r19459
(b) Available since OpenTTD r20377
Descriptions
Airport type override (08)
Works as both substitute type and override. The assignment of this property copies all properties of the old type to this new type. List of valid types: AirportTypes
There's a special use of this property: if you set it to FFh, you can disable an original airport. In this case, the ID used must be the number of airport you want to disable. Disable requests are ignored for airports that have already been overridden.
Set airportlayout(s) (0A)
Format of airport layout tables:
Size | Variable | Meaning |
---|---|---|
B | numlayouts | The total number of layouts following |
D | size | The size in bytes of the whole definition, excluding numlayouts and size |
V | layouts | numlayout layouts, see format below |
Format of an airport layout:
Size | Variable | Meaning |
---|---|---|
B | xoffs | |
B | yoffs | Offsets counted from the northernmost tile of the airport, specifying the position of the current tile. Both are taken as signed integers, but cannot go negative except the special case mentioned below. |
B | oldtile | An old tile type to be put on the given tile |
--or-- | ||
0xFE,W | newtile | The ID of an already defined airport tile, padded with 0 to create a word value. This tile type will be placed on the given tile. |
--or-- | ||
0xFF | The given tile is checked for clearance, but nothing will be placed on it. Useful to ensure some free space around your airport. This is the only case where xoffs and yoffs can be negative. If xoffs is negative, yoffs must be one lower than the wanted value. |
The layout consists of a single byte giving the rotation of the layout (0: north, 2: east, 4: south, 6: west) followed by a list of the above tile definitions, terminated by two bytes: 0,80h
Availability years (0C)
First year and last year the airport is available. 0 and FFFF respectively are forever.
Best compatible TTDPatch airport type (0D)
Used for compatibility with vehicle var 44. Valid values:
0: small airport
1: large airport
2: heliport
3: oilrig