Difference between revisions of "Action0/Vehicles/Ships"

From GRFSpecs
Jump to navigationJump to search
(OpenTTD support for prop 14/15)
(PR #13090)
 
(20 intermediate revisions by 6 users not shown)
Line 1: Line 1:
  +
<div style="float:right; padding-left:12px; background:none;">{{NFONavVehicles}}</div>
  +
 
== Introduction ==
 
== Introduction ==
   
Line 5: Line 7:
   
 
{| |-
 
{| |-
!Number!!Version!![[GRFActionsDetailed|Size]]!!Description
+
!Number!![[GRFActionsDetailed|Size]]!!Version!!Description
 
|-
 
|-
|08|| ||B||Sprite (FF for new graphics)
+
|08||B||{{ottdp|0.6|2.0}}||Sprite (FF for new graphics)
 
|-
 
|-
|09|| ||B||Refittable (0 no, 1 yes)
+
|09||B||{{ottdp|0.6|2.0}}||Refittable (0 no, 1 yes)
 
|-
 
|-
|0A|| ||B||Cost factor
+
|0A||B||{{ottdp|0.6|2.0}}||Cost factor
 
|-
 
|-
|0B|| ||B||Speed in mph*3.2
+
|0B||B||{{ottdp|0.6|2.0}}||Speed in mph*3.2, use property 23 for speeds > 255
 
|-
 
|-
|0C|| ||B||Cargo type, see column 3 (type B) in [[CargoTypes]]
+
|0C||B||{{ottdp|0.6|2.0}}||Cargo type, see [[CargoTypes]]<br/>
  +
{{grfTill|7}} For GRF version 7 and below: Type B 'cargo slot'<br/>
  +
{{grfFrom|8}} For GRF version 8 and above: Type A '(translated) cargo bit'<br/>
  +
{{ottd|15.0}} Since 15.0, a default cargo translation table corresponding to the climate is used if one is not provided.
 
|-
 
|-
|0D|| ||W||Capacity
+
|0D||W||{{ottdp|0.6|2.0}}||Capacity
 
|-
 
|-
|0F|| ||B||Running cost factor
+
|0F||B||{{ottdp|0.6|2.0}}||Running cost factor
 
|-
 
|-
|10|| ||B||Sound effect type (4=cargo ship, 5=passenger ship)
+
|10||B||{{ottdp|0.6|2.0}}||Sound effect type (4=cargo ship, 5=passenger ship)<br/>{{ottdp|1.6|no|ottdrev=r27507}} Since OpenTTD r27507 also custom sound effects from Action11 are allowed here.
 
|-
 
|-
|11||1||D||Bit mask of cargo types available for refitting, see column 2 (bit values) in [[CargoTypes]]
+
|11||D||{{ottdp|0.6|2.0}} {{grfFrom|1}}||Bit mask of cargo types available for refitting, see column 2 (bit values) in [[CargoTypes]]. <b>Obsoleted by properties 1E/1F</b>
 
|-
 
|-
|12||6||B||Callback flags bit mask, see below
+
|12||B||{{ottdp|0.6|2.5}} {{grfFrom|6}}||Callback flags bit mask, see below
 
|-
 
|-
|13||(a)||B||Refit cost, using 1/32 of the default refit cost base
+
|13||B||{{ottdp|0.6|2.5|ttdprev=alpha 30}}||Refit cost, using 1/32 of the default refit cost base
 
|-
 
|-
|14||(b) (g)||B||Ocean speed fraction, sets fraction of top speed available in the ocean; e.g. 00=100%, 80=50%, FF=0.4%
+
|14||B||{{ottdp|1.2|2.5|ttdprev=alpha 44|ottdrev=r22639}}||Ocean speed fraction, sets fraction of top speed available in the ocean; e.g. 00=100%, 80=50%, FF=0.4%
 
|-
 
|-
|15||(b) (g)||B||Canal speed fraction, same as above but for canals and rivers
+
|15||B||{{ottdp|1.2|2.5|ttdprev=alpha 44|ottdrev=r22639}}||Canal speed fraction, same as above but for canals and rivers
 
|-
 
|-
|16||(b)||B||Retire vehicle early, this many years before the end of phase 2 (see [[Action0General]])
+
|16||B||{{ottdp|0.6|2.5|ttdprev=alpha 44}}||Retire vehicle early, this many years before the end of phase 2 (see [[Action0General]])
 
|-
 
|-
|17||(c)||B||Miscellaneous vehicle flags
+
|17||B||{{ottdp|0.6|2.5|ttdprev=alpha 55}}||Miscellaneous vehicle flags
 
|-
 
|-
|18||(c)||W||Refittable cargo classes, see [[Action0Trains#Cargo_classes_.2828.2C_29.29|train prop. 28]]
+
|18||W||{{ottdp|0.6|2.5|ttdprev=alpha 55}}||Refittable cargo classes, see [[Action0Trains#Cargo_classes (28, 29, 32)|train prop. 28]]
 
|-
 
|-
|19||(c)||W||Non-refittable cargo classes, see [[Action0Trains#Cargo_classes_.2828.2C_29.29|train prop. 29]]
+
|19||W||{{ottdp|0.6|2.5|ttdprev=alpha 55}}||Non-refittable cargo classes, see [[Action0Trains#Cargo_classes (28, 29, 32)|train prop. 29]]
 
|-
 
|-
|1A||(d)||D||Long format introduction date
+
|1A||D||{{ottdp|0.6|2.6|ttdprev=r1210|ottdrev=r7191}}||Long format introduction date
 
|-
 
|-
|1B||(e)||B*||Sort the purchase list
+
|1B||B*||{{ottdp|0.7|no|ottdrev=r13831}}||Sort the purchase list
 
|-
 
|-
|1C||(f)||B||Visual effect
+
|1C||B||{{ottdp|1.1|no|ottdrev=r21240}}||Visual effect
|}
 
 
Version codes:
 
 
{| |-
 
!Code!!Version
 
 
|-
 
|-
  +
|1D||W||{{ottdp|1.2|no|ottdrev=r22713}}||Custom cargo ageing period
|(a)||2.0.1 alpha 30
 
 
|-
 
|-
  +
|1E||B n*B||{{ottdp|1.2|no|ottdrev=r23291}}||List of always refittable cargo types, see [[Action0/Vehicles/Trains#List_of_always_refittable_cargo_types_.282C.2C_2D.29|train property 2C]]
|(b)||2.0.1 alpha 44
 
 
|-
 
|-
  +
|1F||B n*B||{{ottdp|1.2|no|ottdrev=r23291}}||List of never refittable cargo types, see [[Action0/Vehicles/Trains#List_of_always_refittable_cargo_types_.282C.2C_2D.29|train property 2D]]
|(c)||2.0.1 alpha 58
 
 
|-
 
|-
  +
|20||W||{{ottdp|13|no}}||Vehicle variant group, see [[Action0/Vehicles/Trains#Vehicle_variant_group_.282F.29|train property 2F]]
|(d)||2.5 r1210, OpenTTD r7191
 
 
|-
 
|-
  +
|21||D||{{ottdp|13|no}}||Extra flags, see [[Action0/Vehicles/Trains#Extra_flags_.2830.29|train property 30]]
|(e)||OpenTTD r13831
 
 
|-
 
|-
  +
|22||B||{{ottdp|14|no|ottdrev=g2d73076056}}||Additional callback flags bit mask, see below
|(f)||OpenTTD r21240
 
 
|-
 
|-
  +
|23||W||{{ottdp|14|no|ottdrev=g5a55c4a934}}||Speed in mph*3.2
|(g)||OpenTTD r22639
 
 
|-
  +
|24||B||{{ottdp|14|no|ottdrev=g5a55c4a934}}||Acceleration in mph*3.2/h (0.5 km-ish/h). Minimum 1, defaults to 1 when omitted
  +
|-
  +
|25||W||{{ottdp|15|no|ottdrev=gd2496b6ec4}}||Cargo classes required for refittability, see [[Action0Trains#Cargo_classes (28, 29, 32)|train prop. 32]]
 
|}
 
|}
   
 
== Descriptions ==
 
== Descriptions ==
   
=== Callbacks (12) ===
+
=== Callbacks (12, 22) ===
For ships, the following [[callbacks]] have to be enabled by setting the corresponding bit in property 12 (certain other, not as frequently used callbacks are available without setting a bit here):
+
For ships, the following [[callbacks]] have to be enabled by setting the corresponding bit in properties 12 and 22 (certain other, not as frequently used callbacks are available without setting a bit here):
   
 
{| |-
 
{| |-
Line 85: Line 88:
 
|-
 
|-
 
|7||80||33||Sound effect callbacks
 
|7||80||33||Sound effect callbacks
  +
|-
  +
|8||100||161||{{ottd|14|ottdrev=gf5394ed2ef}}Engine name
  +
|-
  +
|9||200||163||{{ottdp|15|no|ottdrev=gd2496b6ec4}}Custom refit
 
|}
 
|}
   
 
Bit is the bit you have to set, you do this by adding all the values for all the bits. Variable 0C value is what variable 0C will be set to, for checking it in the VarAction2 for callbacks.
 
Bit is the bit you have to set, you do this by adding all the values for all the bits. Variable 0C value is what variable 0C will be set to, for checking it in the VarAction2 for callbacks.
  +
  +
=== Refit cost (13) ===
  +
  +
Refit cost, using 1/32 of the default refit cost base. This property can be overridden by callback 15E.
  +
  +
{{ottdp|1.2|no|ottdrev=r23087}} If the refit cost factor is set to zero and bit 4 of the miscellaneous flags (17) is set, auto-refitting is allowed.
   
 
=== Miscellaneous flags (17) ===
 
=== Miscellaneous flags (17) ===
Line 99: Line 112:
 
|-
 
|-
 
|1||2||Uses two company colors
 
|1||2||Uses two company colors
  +
|-
  +
|2||4||reserved, do not use
  +
|-
  +
|3||8||reserved, do not use
  +
|-
  +
|4||10||{{ottdp|1.2|no|ottdrev=r23087}} Auto-refitting is enabled for refits where callback 15E allows it or prop 13 specifies zero cost.
  +
|-
  +
|5|| 20||{{ottdp|1.2|no|ottdrev=r23861}} Use cargo multiplier for default cargo. See page about [[VehicleRefitting#Misc._vehicle_flag_5_.27use_of_capacity_multiplier_for_default_cargo.27_set|vehicle refitting]].
  +
|-
  +
|6|| 40||{{ottdp|1.3|no|ottdrev=r24124}} Disable breakdown smoke effect.
  +
|-
  +
|7|| 80||{{ottdp|1.7|no|ottdrev=r27668}} [[Action2/Vehicles#Composing_vehicles_from_multiple_sprites|Compose vehicle from multiple sprites.]]
 
|}
 
|}
   
 
=== Long format introduction date (1A) ===
 
=== Long format introduction date (1A) ===
   
Set the vehicle introduction date, in days since the year 0. This takes account of leap years; dividable by 4, but not 100 unless 400. A start date of 1920-01-01 is obtained with a value of 701265 (51 B3 0A 00). This property must be set after property 00 to take effect. In TTDPatch, dates after 2044 will be limited to 2044.
+
Set the vehicle introduction date, in days since the year 0. This takes account of leap years; dividable by 4, but not 100 unless 400. A start date of 1920-01-01 is obtained with a value of 701265 (51 B3 0A 00). This property must be set after property 00 to take effect.
  +
  +
{{ottdp|no|}} In TTDPatch, dates after 2044 will be limited to 2044.
   
 
=== Sort vehicle list (1B) ===
 
=== Sort vehicle list (1B) ===
Line 110: Line 137:
 
=== Visual effect (1C) ===
 
=== Visual effect (1C) ===
 
See the equivalent [[Action0Trains#Visual_effects_and_wagon_power_.2822.29|train property]] for information about the meaning of all bits. There is no default effect for ships, therefore values of 00..0F will show no visual effect. Bit 7 (disable wagon power) currently has no meaning and should be left at 0.
 
See the equivalent [[Action0Trains#Visual_effects_and_wagon_power_.2822.29|train property]] for information about the meaning of all bits. There is no default effect for ships, therefore values of 00..0F will show no visual effect. Bit 7 (disable wagon power) currently has no meaning and should be left at 0.
  +
  +
=== Custom cargo ageing period (1D) ===
  +
See custom cargo ageing period for [[Action0Trains#Custom_cargo_ageing_period_.282B.29|trains]] for details.
   
 
== Example ==
 
== Example ==

Latest revision as of 21:48, 18 November 2024

Introduction

Defining properties of ships.

Properties

Number Size Version Description
08 B Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 Sprite (FF for new graphics)
09 B Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 Refittable (0 no, 1 yes)
0A B Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 Cost factor
0B B Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 Speed in mph*3.2, use property 23 for speeds > 255
0C B Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 Cargo type, see CargoTypes

GRFv≤7 For GRF version 7 and below: Type B 'cargo slot'
GRFv≥8 For GRF version 8 and above: Type A '(translated) cargo bit'
Supported by OpenTTD 15.015.0 Since 15.0, a default cargo translation table corresponding to the climate is used if one is not provided.

0D W Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 Capacity
0F B Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 Running cost factor
10 B Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 Sound effect type (4=cargo ship, 5=passenger ship)
Supported by OpenTTD 1.6 (r27507)1.6 Not supported by TTDPatch Since OpenTTD r27507 also custom sound effects from Action11 are allowed here.
11 D Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.02.0 GRFv≥1 Bit mask of cargo types available for refitting, see column 2 (bit values) in CargoTypes. Obsoleted by properties 1E/1F
12 B Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5 GRFv≥6 Callback flags bit mask, see below
13 B Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 30)2.5 Refit cost, using 1/32 of the default refit cost base
14 B Supported by OpenTTD 1.2 (r22639)1.2 Supported by TTDPatch 2.5 (alpha 44)2.5 Ocean speed fraction, sets fraction of top speed available in the ocean; e.g. 00=100%, 80=50%, FF=0.4%
15 B Supported by OpenTTD 1.2 (r22639)1.2 Supported by TTDPatch 2.5 (alpha 44)2.5 Canal speed fraction, same as above but for canals and rivers
16 B Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 44)2.5 Retire vehicle early, this many years before the end of phase 2 (see Action0General)
17 B Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 55)2.5 Miscellaneous vehicle flags
18 W Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 55)2.5 Refittable cargo classes, see train prop. 28
19 W Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.5 (alpha 55)2.5 Non-refittable cargo classes, see train prop. 29
1A D Supported by OpenTTD 0.6 (r7191)0.6 Supported by TTDPatch 2.6 (r1210)2.6 Long format introduction date
1B B* Supported by OpenTTD 0.7 (r13831)0.7 Not supported by TTDPatch Sort the purchase list
1C B Supported by OpenTTD 1.1 (r21240)1.1 Not supported by TTDPatch Visual effect
1D W Supported by OpenTTD 1.2 (r22713)1.2 Not supported by TTDPatch Custom cargo ageing period
1E B n*B Supported by OpenTTD 1.2 (r23291)1.2 Not supported by TTDPatch List of always refittable cargo types, see train property 2C
1F B n*B Supported by OpenTTD 1.2 (r23291)1.2 Not supported by TTDPatch List of never refittable cargo types, see train property 2D
20 W Supported by OpenTTD 1313 Not supported by TTDPatch Vehicle variant group, see train property 2F
21 D Supported by OpenTTD 1313 Not supported by TTDPatch Extra flags, see train property 30
22 B Supported by OpenTTD 14 (g2d73076056)14 Not supported by TTDPatch Additional callback flags bit mask, see below
23 W Supported by OpenTTD 14 (g5a55c4a934)14 Not supported by TTDPatch Speed in mph*3.2
24 B Supported by OpenTTD 14 (g5a55c4a934)14 Not supported by TTDPatch Acceleration in mph*3.2/h (0.5 km-ish/h). Minimum 1, defaults to 1 when omitted
25 W Supported by OpenTTD 15 (gd2496b6ec4)15 Not supported by TTDPatch Cargo classes required for refittability, see train prop. 32

Descriptions

Callbacks (12, 22)

For ships, the following callbacks have to be enabled by setting the corresponding bit in properties 12 and 22 (certain other, not as frequently used callbacks are available without setting a bit here):

Bit Value Variable 0C value Callback
2 4 12 Load amount
3 8 15 Set refitted capacity
5 20 19 show a suffix after the cargo type name
6 40 2D Select color mapping for vehicle
7 80 33 Sound effect callbacks
8 100 161 Supported by OpenTTD 1414Engine name
9 200 163 Supported by OpenTTD 15 (gd2496b6ec4)15 Not supported by TTDPatchCustom refit

Bit is the bit you have to set, you do this by adding all the values for all the bits. Variable 0C value is what variable 0C will be set to, for checking it in the VarAction2 for callbacks.

Refit cost (13)

Refit cost, using 1/32 of the default refit cost base. This property can be overridden by callback 15E.

Supported by OpenTTD 1.2 (r23087)1.2 Not supported by TTDPatch If the refit cost factor is set to zero and bit 4 of the miscellaneous flags (17) is set, auto-refitting is allowed.

Miscellaneous flags (17)

This is a bit mask, with the following bits:

Bit Value Meaning
0 1 reserved, do not use
1 2 Uses two company colors
2 4 reserved, do not use
3 8 reserved, do not use
4 10 Supported by OpenTTD 1.2 (r23087)1.2 Not supported by TTDPatch Auto-refitting is enabled for refits where callback 15E allows it or prop 13 specifies zero cost.
5 20 Supported by OpenTTD 1.2 (r23861)1.2 Not supported by TTDPatch Use cargo multiplier for default cargo. See page about vehicle refitting.
6 40 Supported by OpenTTD 1.3 (r24124)1.3 Not supported by TTDPatch Disable breakdown smoke effect.
7 80 Supported by OpenTTD 1.7 (r27668)1.7 Not supported by TTDPatch Compose vehicle from multiple sprites.

Long format introduction date (1A)

Set the vehicle introduction date, in days since the year 0. This takes account of leap years; dividable by 4, but not 100 unless 400. A start date of 1920-01-01 is obtained with a value of 701265 (51 B3 0A 00). This property must be set after property 00 to take effect.

Not supported by OpenTTD Supported by TTDPatch In TTDPatch, dates after 2044 will be limited to 2044.

Sort vehicle list (1B)

See sort vehicle list for trains for details.

Visual effect (1C)

See the equivalent train property for information about the meaning of all bits. There is no default effect for ships, therefore values of 00..0F will show no visual effect. Bit 7 (disable wagon power) currently has no meaning and should be left at 0.

Custom cargo ageing period (1D)

See custom cargo ageing period for trains for details.

Example

To be written