The newcargos switch of TTDPatch allows modifying the existing 12 cargoes per climate, and allows adding 20 new cargoes per climate as well. These cargo slots are numbered from 0 to 31, where slots 0 .. 11 are used by default TTD cargoes and slots 12 .. 31 contain uninitialized garbage by default (so you can't trust them having meaningful information, you must set all of their properties).
| Property function | Description |
| callbacks(<List::Callback>) | List of callbacks, see below |
| cargoabbrev(<String>) | Text ID for cargo type abbreviation |
| cargocapacity(<Byte>) | Vehicle capacity multiplier |
| cargoclasses(<Word>) | Cargo classes |
| cargoicon(<Word>) | Sprite number for the icon of the cargo |
| cargolabel(<Label>) | Cargo label |
| cargoprice(<Dword>) | Base price |
| cargoslot(<Byte>) | Slot of this cargo type, see below |
| cargostatus(<Byte>) | Freight status (for freighttrains switch); 0=not freight, 1=is freight |
| cargotypename(<String>) | Text ID for the cargo type name |
| cargounit(<String>) | Text ID to be displayed for 1 unit of cargo |
| cargounitname(<String>) | Text ID for the name of one unit from the cargo type |
| cargounits(<String>) | Text ID to be displayed for multiple units of cargo |
| cargoweight(<Byte>) | Weight of one unit of the cargo |
| paymentcolour(<Byte>) | Colour for the cargo payment list window |
| penalties(<Byte>*2) | Penalty times |
| stationcolour(<Byte>) | Colour for the station list window |
| towngrowthfactor(<Word>) | Multiplier for town growth |
| towngrowthtype(<Byte>) | Substitute type for town growth |
This property takes as its parameter a list of callbacks to use with this cargo. The following callbacks may be enabled by this function:
| Callback | Description |
| CB_PROFIT | Custom profit calculation |
| CB_RATING | Custom station rating |
TextID for cargo type abbreviation. This one will be used in the station list window to represent the cargo waiting. It should be a two-letter abbreviation prefixed by the special character 0E to switch to the microscopic font. The microscopic font has every letter capitalized, so capitalization isn't important here. Continuing the above example, gold ore could have this as "GO" and milk as "MK" ("ML" is already taken by mail).
This function defines the capacity of vehicles carrying this cargo type, in case the vehicle sets no specific capacity to this specific cargo type, e.g. when being refitted to that cargo. The parameter should be set to the amount of cargo units a vehicle shall carry instead of one ton or one thousand litres (in case of liquids) of cargo.
Supported by OpenTTD since r23860.
Default values are 4 for PASS, and 2 for MAIL.
definecargo(VALU, cargoweight(1) // 62.5 kg cargocapacity(16) // 16 bags == 1 t )
cargoclasses(<List::CargoClass>)
This is a list of all cargo classes to which this cargo belongs, out of the following:
| Label | Meaning |
| TRVL | Passengers |
| POST | |
| EXPRESS | Express cargo (any prioritised cargo) |
| VALUE | Armored cargo (needing security measures, e.g. valuables or gold) |
| BULK | Bulk freight (any non-packaged cargo suitable for pouring, e.g. coal, grain, ore, cement, ...) |
| PGOODS | Piece goods (any unitised cargo, packed or unpacked) |
| LIQUID | Liquids (any liquid or gaseous cargo, food or chemical) |
| REEF | Refrigerated cargo (any goods needing temperature-controlling, e.g. perishable goods, food, or chemicals needing cooling/heating) |
| HAZARD | Hazardous cargo (explosives, acids, radioactive material, ...) |
| COVERED | covered/sheltered freight (any cargo needing moisture protection, i.e. transportation in box vans, silo wagons or containers required) |
| OVERSIZED | Oversized and/or overweight cargo (any cargo needing special means of transportation, e.g. industrial equipment, machinery, large format glass, ... ) |
| POWDER | Powder-shaped material (bulk cargo needing special silo-wagons, e.g. equipped for compressed air unloading; for cargoes like cement, plaster, lime granulates, coal dust, plastic granulate or powder, PVC, metal powders, salt, sugar, semolina, ...) |
Only cargoes which are in class TRVL will appear in bus stations. Only cargoes which are not in class TRVL will appear in truck stations.
Some classes may be combined with others, e.g. COVERED might be combined both with PGOODS and BULK, and OVERSIZED might be combined with PGOODS.
See train property function cargoclasses() for a description of the utility of this property.
This function defines the sprite number for the cargo icon to be displayed in the station window. It's either a sprite number of an old TTD sprite, or NEWICON if the icon is a new sprite referenced by function makecargo(). The icon must not be bigger than 10x10 pixels. One icon will be shown for every 10 units of the cargo waiting, up to 23 icons, which is the maximum.
This function set the cargo label for this cargo. Cargo labels are globally unique identifiers for a cargo type. They are used to allow vehicle newGRFs to easily support many cargo types, whether they are active or not and no matter what slot or bit they are using.
Read about the cargo translation table (CTT) for further info.
This value must be used in function makecargo() and in vehicle cargo bit mask properties such as refit masks. If a cargo translation table is used ..... Values 28 .. 31 should be safe to use (if they aren't already taken, of course) if you intend to maintain compatibility with GRFs unaware of the newcargos switch. Further assuming that no active GRFs support the toyland climate, you can use values 17 .. 26 as well.
Additionally, you can use the value "255" to disable the given cargo slot. This way, it won't appear in cargo type lists, but it won't be removed from things already on the map. If you disable a cargo, you'll probably want to zero out the cargo label in function label() as well.
The textual description of the cargo, capitalized, to match the TTD style (e.g. "Passengers", "Coal", "Gold Ore", "Milk").
This should be either a TTD textid or a text set via deftxt().
TextID for 1 unit of cargo. It will be used to display the amount of the cargo if there's exactly 1 unit waiting. Although there's only one unit waiting, you'll still have to use either the special character 7C (print signed WORD) or 87 (print amount in litres and add suffix " litres") so TTD removes the amount from its internal reference stack. For example, if you have a new cargo named "gold ore", this should be "\7C ton of gold ore", which will expand to "1 ton of gold ore". On the other hand, a liquid cargo named "milk" should be something like "\87 of milk", which will expand to either "100 litres of milk" or "1,000 litres of milk" (The multiplier for liquid cargoes depends on miscmods.dontfixlitres. If it's on, the multiplier is 100, otherwise it's 1000)
TextID for one unit of the type. It should refer to the cargo type name in the singular. Currently, this ID is used only in subsidy messages ("First Passenger service..." instead of "First Passengers service...", for example)
TextID for multiple units of cargo. This will be used to display the amount of cargo if the amount waiting isn't exactly 1. You'll need the same special characters as above, but now they will be expanded according to the actual cargo waiting. Sticking to the example above, you'll need "\7C tons of gold ore" and "\87 of milk", which can expand to "42 tons of gold ore" and "42,000 litres of milk", accordingly. You will note that liquid cargoes can have the same textID for both property 0B and 0C since they always use the plural form.
This function defines the weight of 1 unit of the cargo, which will be used to calculate the weight of the vehicles when loaded. The unit is 1/16 ton (which is 62.5 kg). With the examples above, gold ore should have this as 16 (since 1 ton of gold ore should weigh exactly 1 ton), while milk should have this slightly above 16 (milk is denser than water).
This function defines the colour which will be used to draw the graph of the current cargo in the cargo payment rates graph. The index should be given for the DOS palette (see above), the Windows version of TTDPatch will automatically translate the index for the Windows palette.
This function defines the 'penalty times'. Together with price(), these values define how much is paid for the delivery of the cargo type. The price factor is subject to inflation, but newGRFs needn't care about this, TTDPatch will adjust the price for them.
The income generated from cargo delivery is calculated as:
where
'a >> b' means a is arithmetically shifted right by b bits,
'distance' is the Manhattan distance between the two station signs,
'amount_moved' is the number of cargo units moved,
'cargopricefactor' is the value you set in property function price(). TTDPatch will automatically apply inflation on it.
'timefactor' is a multiplier in the range 0 .. 255, calculated in the following way:
Where 'T1' is the value of the first parameter, 'T2' is the value of the second, 't' is the time the delivery took, the unit is 185 game ticks (roughly 2.5 game days), respectively the value set by cargoaging().
If the above rules result in a timefactor less than 31, 31 is used instead.
This function defines the colour which will be used to draw the rectangle representing the amount waiting from the current cargo type in the station list window. The index should be given for the DOS palette, the Windows version of TTDPatch will automatically translate the index for the Windows palette.
towngrowthtype(<Byte>), towngrowthfactor(<Word>)
Following two properties exist for TTDPatch 2.0.1 alpha 72 and above only.
These two functions allow to modify how a cargo type affects town growth, by setting the growth type and the multiplier for town growth.
towngrowthtype() may contain one of the following values:
| Value | Meaning | Details(*) |
| LIKEPASS | Affect towns as passengers do | Cargo produced by houses is added to the statistics in the town GUI. |
| LIKEMAIL | Affect towns as mail does | Cargo produced by houses is added to the statistics in the town GUI. |
| LIKEGOODS | Affect towns as goods/candy does | See note about subsidies below. |
| LIKEWATER | Affect towns as water does | Second required cargo for towngrowth in the desert. |
| LIKEFOOD | Affect towns as food/fizzy drinks do | First required cargo for towngrowth in desert/above snowline. Alse see note about subsidies below. |
| DEFAULT | Don't affect town growth (default) |
(*) This is the interpretation of OpenTTD. For TTDPatch see NewTownGrowthMechanism.
The incoming cargo amount is multiplied by towngrowthfactor(), then divided by 256 before it is added to the town statistics. This allows you to have smaller or bigger impact than original cargoes do. Please note that cargoes accepted by industries affect the closest town as well. For example, if you have an industry that accepts passengers, every passenger brought to the industry affects the town just like if they were transported to the town directly. Usually, it's not a good idea to have industries that process such cargoes; they should be accepted by towns only.
Note: In OpenTTD towngrowthtype() also affects the creation of subsidies. Usually subsidies apply to cargo transportation between two industries. For cargoes with substitution-type GOOD or FOOD the destination will be a town instead. Independent of towngrowthtype() subsidies from town to town are only created for Passengers.