Table of Contents

Cargo Types

Cargo Types are used to define the different freights that should be transported in Transport Fever 2. They are configured in .lua files in the res/config/cargo_types/ folder.

Configuration

The basic structure of a cargo type config is:

function data()
return 
  { 
    id = "IRON_ORE", 
    name = _("Iron ore"), 
    weight = 1200.0,
    order = 4,
    levelModels = { 
      MEDIUM4x1 = "industry/cargo/level/iron_ore_level_4x1.mdl", 
      MEDIUM2x1 = "industry/cargo/level/iron_ore_level_2x1.mdl"
    },
    discreteModels = { 
      SMALL = "industry/cargo/iron_ore_small.mdl", 
      BIG = "industry/cargo/iron_ore_big.mdl"
    },
    townInput = { "INDUSTRIAL", },
  }
end

The properties are:

Cargo Models





Cargo types provide generic models that are automatically fitted in the cargo bays of vehicles and displayed on station plattforms or in stock areas of industries. The models are referenced in the levelModels or discreteModels block.

The levelModels block is used for surface models in open wagons and tippers to visualize bulk cargo.

The discreteModels block is used for every other model. These are used outside of vehicles too.

It is recommended that the small models have a volume of approximately 1 cubic meter. The big models can be bigger. For both models, it is recommended that they are formed to be stackable so that cargo vehicles can use several layers of the models. Keep this in mind when defining the bounding box too to get the height right.

For all cargo models, the model origin should be in the center of the bottom.

It is possible to use these generic models for the custom cargo model configurations too by prefixing the key with # like “#MEDIUM4x1”.

UI Icons

The cargo icons are located in the res/textures/ui/hud/ folder. They each are named like <cargo_type_filename>@2x.tga and have a height of 50 pixels. The icons use a flat style without shadows and have a black outline to improve contrast ingame.