Changes

Jump to navigation Jump to search

Games/ETS2/Modding guides/1.54

2,161 bytes added, 18 March
Cargo system
New cargo system aims to decouple trailer and it's cargo model to generic assembly. Where trailers with specific loading methods will be able to automatically load any cargo that uses it. The system is designed to independently define trailer data from cargo data.
Basically binding cargo to trailer remains the same via cargo model match. What changes is how this two are bound together. If for example you are working on a new trailer that should support existing cargoes in the game you just need to define body with proper '''''cargo_loading_methods''''' and rest of auxiliary data in the body. No need for cargo data extension.
Similarly if you want to add new cargo, in majority of cases you don't need to touch any trailer data. Everything should work once you define new cargo model match, except in the case of '''''custom''''' loading method where you need to define custom loads data per body per cargo. This loading method should be last resort in case you special cargo is not able to use any other loading method.
So in summary what you need to do, depends whether you are adding new trailer or new cargo to the game:
=== 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 whether body should have warning signs part switching supported or not
* '''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.
* '''open_model''' - string as path to the model placed on lashing mount when lashing is done to it
* '''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_x</code> and <code>lashm_e_x</code> where <code>x</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.
==== Cargo Lashing Gear ====
* '''lashing_hook_angle_constraints''' - float3 defining angle constraint on each axis of the hook in range between 0 and 90° (this will work similarly as angle constriants on body lashing mounts except that his is applied only when <code>direct</code> lashing is used for the cargo model match)
=== Common structures Cargo loading methods ===TBAAs written above, cargo loading method will tell cargo and trailer how specific cargo model match will be loaded onto the trailer. The loading is done by the game differently for each loading method:* '''area''' - cargo placed on area, game automatically calculates number of cargo model matches that can fit onto the trailer* '''area_cont_20ft''' - variation of '''''area''''' for 20ft containers* '''area_cont_40ft''' - variation of '''''area''''' for 40ft containers* '''area_cont_45ft''' - variation of '''''area''''' for 45ft containers* '''area_cont_53ft''' - variation of '''''area''''' for 53ft containers* '''area_cylinder''' - cylindrical cargo placed into prism volume defined by bottom and top area* '''area_logger''' - variation of '''''area''''' for loggers with side support* '''auxiliary_only''' - no real cargo it has only auxiliary models placed on custom nodes (e.g. ADR, reefer lights)* '''bulk''' - bulk cargo loaded with mesh generation* '''custom''' - cargo placed on custom placement according to cargo locator and '''''cargo_custom_load_data_u'''''' defined inside body === Cargo lashing methods ===Lashing method defines how cargo will be lashed to the trailer:* '''direct''' - cargo is lashed directly from rigid point on cargo to the trailer lashing mounts utilizing* '''top_over''' - cargo is lashed with top over technique, trying to find perpendicular lashing against the loading area Each method requires different locators within the cargo model:* '''''direct''''': requires locators with naming: <code>lash_d_x</code> where <code>x</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 locators

Navigation menu