Difference between revisions of "Action0/Vehicles/Ships"

From GRFSpecs
Jump to navigationJump to search
(table and style)
m (Reverted edits by Planetmaker (Talk) to last revision by Orudge)
Line 1: Line 1:
=Action 0 - Properties for road vehicles=
 
   
  +
'''''Action 0 properties for ships'''''
Defining properties of road vehicles.
 
   
  +
=Action 0 - Properties for ships=
   
  +
Defining properties of ships.
=Properties=
 
   
  +
{maketoc}
{| |-
 
!Number!!Version!!Size!!Description!!Available for articulated parts
 
|-
 
|08|| ||B||Speed in mph*3.2||no
 
|-
 
|09|| ||B||Running cost factor||should be zero
 
|-
 
|0A|| ||D||Running cost base, see below||should be zero
 
|-
 
|0E|| ||B||Sprite ID (FF for new graphics)||yes
 
|-
 
|0F|| ||B||Capacity||yes
 
|-
 
|10|| ||B||Cargo type, see column 3 (type B) in [[CargoTypes]]||yes
 
|-
 
|11|| ||B||Cost factor||should be zero
 
|-
 
|12|| ||B||Sound effect: 17/19/1A for regular, 3C/3E for toyland||no
 
|-
 
|13||2||B||Power in 10 hp, see below||should be zero
 
|-
 
|14||2||B||Weight in 1/4 tons, see below||should be zero
 
|-
 
|15||2||B||Speed in mph*0.8, see below||no
 
|-
 
|16||2||D||Bit mask of cargo types available for refitting (not refittable if 0 or unset), see column 2 (bit values) in [[CargoTypes]]||yes
 
|-
 
|17||6||B||Callback flags bit mask, see below||yes
 
|-
 
|18||(a)||B||Coefficient of tractive effort||should be zero
 
|-
 
|19||(a)||B||Coefficient of air drag||should be zero
 
|-
 
|1A||(a)||B||Refit cost, using 25% of the [[BaseCosts|purchase price cost base]]||yes
 
|-
 
|1B||(b)||B||Retire vehicle early, this many years before the end of phase 2 (see [[Action0General]])||no
 
|-
 
|1C||(c)||B||Miscellaneous vehicle flags||partly ("tram" should be same as front)
 
|-
 
|1D||(c)||W||Refittable cargo classes, see [[Action0Trains#Cargo_classes_28_29_|train prop. 28]]||yes
 
|-
 
|1E||(c)||W||Non-refittable cargo classes, see [[Action0Trains#Cargo_classes_28_29_|train prop. 29]]||yes
 
|-
 
|1F||(d)||D||Long format introduction date||no
 
|-
 
|20||(e)||B*||Sort the purchase list||no
 
|-
 
|21||(f)||B||Visual effect||yes
 
|}
 
   
  +
-=Properties=-
Version codes:
 
   
  +
||Number|Version|Size|Description
{| |-
 
!Code!!Version
 
|-
 
|(a)||2.0.1 alpha 30
 
|-
 
|(b)||2.0.1 alpha 44
 
|-
 
|(c)||2.0.1 alpha 58
 
|-
 
|(d)||2.5 r1210, OpenTTD r7191
 
|-
 
|(e)||OpenTTD r13831
 
|-
 
|(f)||OpenTTD r21240
 
|}
 
   
  +
08| |B|Sprite (FF for new graphics)
=Comments=
 
   
  +
09| |B|Refittable (0 no, 1 yes)
==Running cost base (0A) and factor (09)==
 
   
  +
0A| |B|Cost factor
TTD calculates all costs by multiplying a 48-bit base amount with an 8-bit factor.  The base amount is changed according to inflation, whereas the factor remains constant.
 
   
  +
0B| |B|Speed in mph*3.2
For the running costs of road vehicles, the following base amounts are available:
 
   
  +
0C| |B|Cargo type, see column 3 (type B) in [[CargoTypes]]
{| |-
 
!Type!!Value!!in little-endian notation
 
|-
 
|Road vehicle running cost base||4C48||48 4C 00 00
 
|}
 
   
  +
0D| |W|Capacity
Theoretically, you could use pointers to other [[BaseCosts|base amounts]] available in TTD, but these are the numbers TTD uses for road vehicles.
 
   
  +
0F| |B|Running cost factor
==Cost factor (11)==
 
   
  +
10| |B|Sound effect type (4=cargo ship, 5=passenger ship)
The cost factor is a bit-coded value which determines how expensive a vehicle is. The table below gives you some values to use for finding the right price for your vehicles.
 
   
  +
11|1|D|Bit mask of cargo types available for refitting, see column 2 (bit values) in [[CargoTypes]]
{| |-
 
!Cost factor!!Price
 
|-
 
|00||$ 0
 
|-
 
|01||$ 108
 
|-
 
|10||$ 1,750
 
|-
 
|20||$ 3,500
 
|-
 
|80||$ 14,000
 
|-
 
|FF||$ 27,890
 
|}
 
   
  +
12|6|B|Callback flags bit mask, see below
==Realistic acceleration properties (13, 14, 15)==
 
   
  +
13|(a)|B|Refit cost, using 1/32 of the default refit cost base
TTDP uses these properties only if road vehicles are set to realistic acceleration in the NewCurveAndMountainHandling switch. They are ignored otherwise.
 
   
  +
14|(b)|B|Ocean speed fraction, sets fraction of top speed available in the ocean; e.g. 00=100%, 80=50%, FF=0.4%
OpenTTD uses these properties always, if they are defined and gives the speed defined here precedence over the one defined in property 08.
 
   
  +
15|(b)|B|Canal speed fraction, same as above but for canals
Using property 15 to set the speed, it is possible to achieve speeds larger than 80 mph (127 km/h), to which property 08 is limited. When setting property 15, always set property 08 as well, so that the vehicle works reasonably well whether realistic acceleration is turned on or off. If property 15 is not set, the value from property 08 is used instead.
 
   
  +
16|(b)|B|Retire vehicle early, this many years before the end of phase 2 (see [[Action0General]])
==Callbacks (17)==
 
   
  +
17|(c)|B|Miscellaneous vehicle flags
For road vehicles, the following [[Callbacks|callbacks]] have to be enabled by setting the corresponding bit in property 17 (certain other, not as frequently used callbacks are available without setting a bit here):
 
   
  +
18|(c)|W|Refittable cargo classes, see [[Action0Trains#Cargo_classes_28_29_|train prop. 28]]
{| |-
 
!Bit!!Value!!Variable 0C value!!Callback
 
|-
 
|1||2||11||Wagon length
 
|-
 
|2||4||12||Load amount
 
|-
 
|3||8||15||Set refitted capacity
 
|-
 
|4||10||16||Build articulated vehicle
 
|-
 
|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
 
|}
 
   
  +
19|(c)|W|Non-refittable cargo classes, see [[Action0Trains#Cargo_classes_28_29_|train prop. 29]]
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 variational action 2 for callbacks.
 
   
  +
1A|(d)|D|Long format introduction date
==Coefficient of tractive effort (18)==
 
   
  +
1B|(e)|B*|Sort the purchase list
This cofficient sets what fraction of the vehicle weight is equal to the maximum tractive effort.  This includes the effect of having some unpowered axles, as well as the coefficient of friction that is available.
 
   
  +
1C|(f)|B|Visual effect||
For a value of FF, the tractive effort is equal to the vehicle weight, for 80, it is half, and so on.  If not set, a default of 4C is used, for a fraction of 0.30, corresponding to Wadh=W and a coefficient of friction of 0.30, which is the value used by the patch before 2.0.1 alpha 19.
 
   
  +
Version codes:
==Coefficient of air drag (19)==
 
   
  +
||Code|Version
This property sets the air drag coefficient c2 used for the realistic acceleration model, from 01 (no airdrag) to FF (most air drag) in arbitrary units.  00 means to use the default value that depends on the top speed (to simulate the fact that high-speed engines are more streamlined).
 
   
  +
(a)|2.0.1 alpha 30
The default values are the following:
 
   
  +
(b)|2.0.1 alpha 44
{| |-
 
!top speed (mph/1.6)!!<16!!16!!24!!32!!48!!64!!96!!128!!192!!256!!...
 
|-
 
|c2||192||128||96||64||48||32||24||16||12||8
 
|}
 
   
  +
(c)|2.0.1 alpha 58
For higher speeds, the series is continued in the same manner.
 
   
  +
(d)|2.5 r1210, OpenTTD r7191
Air drag in Newtons will then be c2*v*v with v in m/s, although it is probably futile to attempt to make c2 a realistic number due to the lack of TTd's consistent scaling.  If a vehicle doesn't reach its historical top speed, you might try setting prop. 19 one or two higher than the default above, otherwise it's probably a good idea to leave it at the default.
 
   
  +
(e)|OpenTTD r13831
==Miscellaneous flags (1C)==
 
  +
  +
(f)|OpenTTD r21240||
  +
  +
-=Comments=-
  +
  +
==Callbacks (12)==
  +
  +
For ships, the following [[Callbacks|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):
  +
  +
||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||
  +
  +
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 variational action 2 for callbacks.
  +
  +
==Miscellaneous flags (17)==
   
 
This is a bit mask, with the following bits:
 
This is a bit mask, with the following bits:
   
  +
||Bit|Value|Meaning
{| |-
 
  +
!Bit!!Value!!Meaning
 
  +
0|1|reserved, do not use
|-
 
  +
|0||1||Vehicle is a tram/light rail vehicle and requires tram tracks to operate
 
  +
1|2|Uses two company colors||
|-
 
|1||2||Uses two company colors
 
|}
 
   
==Long format introduction date (1F)==
+
==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. In TTDPatch, dates after 2044 will be limited to 2044.
   
==Sort vehicle list (20)==
+
==Sort vehicle list (1B)==
   
 
See sort vehicle list for [[Action0Trains#Sort_vehicle_list_1A_|trains]] for details.
 
See sort vehicle list for [[Action0Trains#Sort_vehicle_list_1A_|trains]] for details.
   
==Visual effect (21)==
+
==Visual effect (1C)==
   
See the equivalent [[Action0Trains#Visual_effects_and_wagon_power_22_|train property]] for information about the meaning of all bits. There is no default effect for road vehicles, 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_22_|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.

Revision as of 09:25, 13 June 2011

Action 0 properties for ships

Action 0 - Properties for ships

Defining properties of ships.

{maketoc}

-=Properties=-

||Number|Version|Size|Description

08| |B|Sprite (FF for new graphics)

09| |B|Refittable (0 no, 1 yes)

0A| |B|Cost factor

0B| |B|Speed in mph*3.2

0C| |B|Cargo type, see column 3 (type B) in CargoTypes

0D| |W|Capacity

0F| |B|Running cost factor

10| |B|Sound effect type (4=cargo ship, 5=passenger ship)

11|1|D|Bit mask of cargo types available for refitting, see column 2 (bit values) in CargoTypes

12|6|B|Callback flags bit mask, see below

13|(a)|B|Refit cost, using 1/32 of the default refit cost base

14|(b)|B|Ocean speed fraction, sets fraction of top speed available in the ocean; e.g. 00=100%, 80=50%, FF=0.4%

15|(b)|B|Canal speed fraction, same as above but for canals

16|(b)|B|Retire vehicle early, this many years before the end of phase 2 (see Action0General)

17|(c)|B|Miscellaneous vehicle flags

18|(c)|W|Refittable cargo classes, see train prop. 28

19|(c)|W|Non-refittable cargo classes, see train prop. 29

1A|(d)|D|Long format introduction date

1B|(e)|B*|Sort the purchase list

1C|(f)|B|Visual effect||

Version codes:

||Code|Version

(a)|2.0.1 alpha 30

(b)|2.0.1 alpha 44

(c)|2.0.1 alpha 58

(d)|2.5 r1210, OpenTTD r7191

(e)|OpenTTD r13831

(f)|OpenTTD r21240||

-=Comments=-

Callbacks (12)

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):

||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||

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 variational action 2 for callbacks.

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||

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.

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.