If you have already updated a vehicle-mod for the old CCW of TPF1, you know the steps already:
Payload and loading volume have to be defined in the model definition (*.mdl file). Add new lines for maxWeight and maxVolume in block of transportVehicle and you are done.
The maximum payload must be given in metric ton (t). Payload just means the allowed weight of cargo without the weight of the vehicle itself.
The maximum loading volume must be given in cubic meter (m³). Loading volume means the full volume of the loading area. In most cases, this will be equal to the volume that can be calculated through the coordinates given to bbMin and bbMax if given.
Please use only real values. Unreal values will just break fun of the wanted challenge.
The block for transportVehicle is documented in TPF2-Wiki here: https://www.transportfever2.co…layer_controlled_vehicles
Just add the two mentioned values there and the script mod will calculate real capacities.
illustrative example:
transportVehicle = {
... -- already given block
maxWeight = 60.0, -- payload in t
maxVolume = 100.0, -- loading volume in m³
},
hint: don't forget the comma at the end of the last already given line
Compartments for wagons/ trailers
It is a little more complex if you want to map different configurations of a vehicle with different loading areas using compartments. An example of this would be a tandem truck with trailer. In this case, the capacity and payload may be different for the truck and the trailer. Or you want to model cargo streetcars with different wagons.
With the version from 07.02.2024, lists are also supported for maxWeight and maxVolume. This list must have exactly as many entries as the number of compartments defined. This means that the payload and load volume can be set individually for each compartment.
Illustrative example for 2 compartments:
transportVehicle = {
... -- already given block
maxWeight = {30.0, 30.0}, -- payload in t
maxVolume = {50.0, 50.0}, -- loading volume in m³
},
hint: don't forget the comma at the end of the last already given line