Difference between revisions of "VehicleRefitting"

From GRFSpecs
Jump to navigationJump to search
(grf version 8)
(mention loading speed in misc flag 5)
 
(5 intermediate revisions by the same user not shown)
Line 4: Line 4:
   
 
Vehicles have multiple properties and callbacks which define the default cargotype and capacity, the refitoptions and the capacities after refitting.
 
Vehicles have multiple properties and callbacks which define the default cargotype and capacity, the refitoptions and the capacities after refitting.
* {{grf|7}} For GRF version 7 and below: Default cargo slot (trains, road vehicles, ships)
+
* {{grfTill|7}} For GRF version 7 and below: Default cargo slot (trains, road vehicles, ships)
* {{grf|8}} For GRF version 8 and above: Default cargo bit (trains, road vehicles, ships)
+
* {{grfFrom|8}} For GRF version 8 and above: Default cargo bit (trains, road vehicles, ships)
 
* Default capacity (trains, road vehicles, ships)
 
* Default capacity (trains, road vehicles, ships)
* Passenger capacity (aircraft)
+
* Primary cargo capacity (aircraft)
* Mail capacity (aircraft)
+
* Secondary cargo capacity (aircraft)
 
* Refit mask (all vehicle types)
 
* Refit mask (all vehicle types)
 
* Refittable cargo classes (all vehicle types)
 
* Refittable cargo classes (all vehicle types)
 
* Non-refittable cargo classes (all vehicle types)
 
* Non-refittable cargo classes (all vehicle types)
  +
* {{ottdp|1.2|no}} Refittable cargo types (all vehicle types)
  +
* {{ottdp|1.2|no}} Non-refittable cargo types (all vehicle types)
  +
* {{ottdp|1.2|no}} Misc. vehicle flag 5 'use of capacity multiplier for default cargo' (all vehicle types)
 
* 'Refittable'-flag (ships)
 
* 'Refittable'-flag (ships)
 
* [[Callbacks#Change vehicle properties (36) |Callback 36]] 'capacity' (all vehicle types)
 
* [[Callbacks#Change vehicle properties (36) |Callback 36]] 'capacity' (all vehicle types)
* Callbck 15 'refitted capacity'
+
* [[Callbacks#Refitted_capacity_callback_.2815.29|Callback 15]] 'refitted capacity' (all vehicle types)
  +
* {{ottdp|1.2|no}} [[Action0/Cargos#Capacity_multiplier_.281D.29|Cargo property 1D 'capacity multiplier']]
   
 
== Flow chart ==
 
== Flow chart ==
  +
=== Misc. vehicle flag 5 'use of capacity multiplier for default cargo' cleared ===
{{ottdp|1.0}} The following image visualises the interactions of these wrt. OpenTTD. If you know the behaviour of TTDPatch at that detail level, please elaborate.
+
{{ottdp|1.0}} The following image visualises the interactions of the various properties and callbacks wrt. OpenTTD. If you know the behaviour of TTDPatch at that detail level, please elaborate.
[[File:CargoMagic.dot.png|thumb|center|800px]]
 
  +
  +
Behaviour in OpenTTD 1.0.x and 1.1.x:
 
[[File:CargoMagic10.dot.png|thumb|center|800px]]
  +
  +
Behaviour in OpenTTD 1.2.x with new refittable cargo types properties:
  +
[[File:CargoMagic12flag5cleared.dot.png|thumb|center|800px]]
  +
  +
=== Misc. vehicle flag 5 'use of capacity multiplier for default cargo' set ===
  +
{{ottdp|1.2}} If vehicle misc. flag 5 is set, the behaviour changes slightly.
  +
* The default cargotype does no longer affect the capacity of other refits. (Which would be troublesome if the default cargotype is not known.)
  +
* The capacity property (including the "primary capacity" of aircraft) and callback 36 return the capacity in a generic unit ("tons of coal"), independent of the actual transported cargo type.
  +
* Callback 15 is called always; also for the default cargo type, and also in purchase list.
  +
These changes allow vehicles to set specific capacities for cargotypes they know (via CB 15), and set a generic capacity (in "tons of coal") for other cargotypes. The capacity of unknown cargo types is then controlled by the cargo definition, which also controls the refittability via cargo classes. (Note that, if the cargo definition scales the capacity, it also scales the load amount per gradual loading step accordingly, so the overall loading time stays the same.)
  +
  +
[[File:CargoMagic12flag5set.dot.png|thumb|center|800px]]

Latest revision as of 20:48, 26 June 2013

Introduction

Vehicles have multiple properties and callbacks which define the default cargotype and capacity, the refitoptions and the capacities after refitting.

  • GRFv≤7 For GRF version 7 and below: Default cargo slot (trains, road vehicles, ships)
  • GRFv≥8 For GRF version 8 and above: Default cargo bit (trains, road vehicles, ships)
  • Default capacity (trains, road vehicles, ships)
  • Primary cargo capacity (aircraft)
  • Secondary cargo capacity (aircraft)
  • Refit mask (all vehicle types)
  • Refittable cargo classes (all vehicle types)
  • Non-refittable cargo classes (all vehicle types)
  • Supported by OpenTTD 1.21.2 Not supported by TTDPatch Refittable cargo types (all vehicle types)
  • Supported by OpenTTD 1.21.2 Not supported by TTDPatch Non-refittable cargo types (all vehicle types)
  • Supported by OpenTTD 1.21.2 Not supported by TTDPatch Misc. vehicle flag 5 'use of capacity multiplier for default cargo' (all vehicle types)
  • 'Refittable'-flag (ships)
  • Callback 36 'capacity' (all vehicle types)
  • Callback 15 'refitted capacity' (all vehicle types)
  • Supported by OpenTTD 1.21.2 Not supported by TTDPatch Cargo property 1D 'capacity multiplier'

Flow chart

Misc. vehicle flag 5 'use of capacity multiplier for default cargo' cleared

Supported by OpenTTD 1.01.0 Not supported by TTDPatch The following image visualises the interactions of the various properties and callbacks wrt. OpenTTD. If you know the behaviour of TTDPatch at that detail level, please elaborate.

Behaviour in OpenTTD 1.0.x and 1.1.x:

CargoMagic10.dot.png

Behaviour in OpenTTD 1.2.x with new refittable cargo types properties:

CargoMagic12flag5cleared.dot.png

Misc. vehicle flag 5 'use of capacity multiplier for default cargo' set

Supported by OpenTTD 1.21.2 Not supported by TTDPatch If vehicle misc. flag 5 is set, the behaviour changes slightly.

  • The default cargotype does no longer affect the capacity of other refits. (Which would be troublesome if the default cargotype is not known.)
  • The capacity property (including the "primary capacity" of aircraft) and callback 36 return the capacity in a generic unit ("tons of coal"), independent of the actual transported cargo type.
  • Callback 15 is called always; also for the default cargo type, and also in purchase list.

These changes allow vehicles to set specific capacities for cargotypes they know (via CB 15), and set a generic capacity (in "tons of coal") for other cargotypes. The capacity of unknown cargo types is then controlled by the cargo definition, which also controls the refittability via cargo classes. (Note that, if the cargo definition scales the capacity, it also scales the load amount per gradual loading step accordingly, so the overall loading time stays the same.)

CargoMagic12flag5set.dot.png