Open main menu

Changes

Games/ETS2/Modding guides/1.54

201 bytes added, 18 March
Cargo system
=== Trailer data ===
To support cargo loading and lashing on trailer, body accessory needs to be used, it's mandatory, since cargo system loads new attributes from it:
* '''cargo_loading_methods[]''' - array of tokens representing supported cargo [loading methods|#Loading-Methods] by this body
* '''cargo_regular_width''' - float representing at which width extension parts for the trailer are switched on
* '''cargo_warning_signs''' - bool value indicatin indicating whether body should have warning signs part switching supported or not, see [more|#Warning signs]
* '''cargo_areas''' - array of area sizes (X,Z) that are used for any of area based loading method
* '''cargo_areas_cylinder_data[]''' - array aligned with cargo areas, storing additional data for cylinder based loading (each item representing height, slope angle for given cargo area)
* '''cargo_custom_loads[]''' - array of '''cargo_custom_load_data_u''' unit pointers storing custom load offset per cargo* '''cargo_lashing_mounts[]''' - array of '''cargo_lashing_mount_u''' unit pointers storing lashing mount definitions
* '''cargo_lashing_strap''' - unit pointer to '''cargo_lashing_gear_u''' storing configuration of lashing gear used when strap gear method is sečected by the cargo model match
* '''cargo_lashing_chain''' - unit pointer to '''cargo_lashing_gear_u''' storing configuration of lashing gear used when chain gear methods is selected by the cargo model match.
* '''closed_model''' - string as path to the model placed on lashing mount when when spaced position is not used (this model will be placed only in case spacing is grater than 0)
For lashing mount to be correctly loaded the body or chassis (if body model is not defined) has to have proper model locators pair: <code>lashm_s_xlashm_s_X</code> and <code>lashm_e_xlashm_e_X</code> where <code>xX</code> is the index of the lashing mount inside the '''''cargo_lashing_mounts''''' array of the trailer body data. First locator is representing the start and second is representing the end of the lashing mount. Note that lashing mounts should be placed on forward vehicle axis from front to the rear of the vehicle.
==== Cargo Lashing Gear ====
=== Cargo model match data ===
Cargo model match units were moved into vehicle definition space, since they are only to be used in conjunction with the vehicle and cargo loading logic. Additionally existing cargo model match unit was refactored and now supports following attributes:
* '''data_path[]''' - array of strings defining different models of same cargo model match (aka has same dimensions but different look)
* '''dimensions''' - float3 representing dimensions of the cargo model match in each axis (X,Y,Z). Y component is currently ignored however might be used in the future.
* '''unit_volume_factor''' - float as factor of the cargo unit volume defined in cargo data. This is usually used to distinguish different cargo model matches of the same cargo, that have completely different visual and thus different ratio to the cargo unit volume. Unless you are not defining new cargo model matches for existing cargo nor you have multiple cargo model matches you should not define it
Each method requires different locators within the cargo model:
* '''''direct''''': requires locators with naming: <code>lash_d_xlash_d_X</code> where <code>xX</code> is incremental index from 0 to 99. As soon model locator for given index is not found rest will be ignored* '''''top_over''''': requires lashing rail locatorswith naming: <code>lash_s_Z_X</code> and <lash_e_Z_X</code>