Open main menu

Changes

Games/ETS2/Modding guides/1.54

3,757 bytes added, 28 March
m
Trailer data
* '''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 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 selected 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.
* '''wrn_sgn_32''' part will be switched on if loaded cargo width is above 2.9m and under 3.2m
* '''wrn_sgn_max''' part will be switched on if loaded cargo width is above 3.2m
 
Additionally if loaded cargo is wider than set '''''cargo_regular_width''''' in the body data, then extension parts on the trailer body or chassis (if trailer body model is not present) will be switched on. Extension parts are collected differently depending on the loading method:
* For '''''area''''' based loading methods game searches for the parts <code>larea_on_X</code> and <code>larea_off_X</code> where <code>X</code> is the index of the area from '''''cargo_areas[]''''' attribute.
* For rest of the loading methods game will be searching for the parts <code>cargo_on</code> and <code>cargo_off</code>.
In both cases game will make sure to disable any part not belonging to the currently used loading method. When '''''area''''' loading is used both <code>cargo_on</code> and <code>cargo_off</code> will be disabled and vice versa, when non-area based loading method is used any <code>larea_on_X</code> and <code>larea_off_X</code> will be disabled.
==== Cargo Custom Load Data ====
* '''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
* '''loading_method''' - token of the loading method cargo model match will be using, see [more|[#Loading Cargo loading methods]]* '''lashing_method''' - token of the lashing method cargo model match will be using, see [more|[#Lashing Cargo lashing methods]]* '''lashing_gear_type''' - token of the lashing device cargo model match will be using, see [more|[#Lashing Cargo lashing gear types]]
* '''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 ===Common structures are either used directly or indirectly on both sides. ==== Cargo loading methods ====
As 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
* '''custom''' - cargo placed on custom placement according to cargo locator and '''''cargo_custom_load_data_u'''''' defined inside body
All area based loading methods will be looking for the <code>larea_s_X</code> and <code>larea_e_X</code> model locators inside body or chassis (if body model is not present), where <code>X</code> is the index of loading area inside the trailer body data '''''cargo_areas[]''''' attribute. This locators define corners for each loading area plane. ==== 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
* '''none''' - cargo is not lashed, this can be used in combination with cargoes that are embedded on the trailer or lashed on itself
 
Each method (except '''''none''''') requires different locators within the cargo model.
 
For '''''direct''''' lashing cargo model needs 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. Lashing will be done in the direction of model locator forward axis, game will pick closest possible lashing mount placement from the vehicle.
 
For '''''top_over''''' lashing cargo model requires lashing rail locators with naming: <code>lash_s_Z_X</code> and <code>lash_e_Z_X</code> where <code>Z</code> donates index of multiple rails along model forward axis and <code>X</code> donates index of multiple rails along model X axis. Multiple rails are usually used when there is some obstruction in the model and you need manual dividing into multiple railing (e.g. some separation elements). In all other cases one should use single Z rail indexing since the game will place multiple lashings on the distance of 1.25m from each other. X indexing should be done from left to the right (from -X to +X in model space)
 
==== Cargo lashing gear types ====
There are currently two different lashing gear types:
* '''chain''' - game creates diamond intersections segments to simulate chain mesh with a combination of alpha test material
* '''strap''' - game creates square intersection segments to simulate strap mesh
* '''none''' - game doesn't use any lashing, should be used in conjunction with '''''none''''' lashing method
 
=== Traffic trailer data ===
As for the traffic vehicles, they got reworked too. Similarly as player vehicles, they now need linked '''trailer_def_u''' and list of the cargoes they support via new attribute '''cargoes[]''' which is an array of cargo name tokens. So if you want to create new traffic trailer one would need to:
# link permanent trailer definition from <code>/def/vehicle/trailer_defs/</code>
# add body accessory to it
# supply array of supported cargoes.
 
Example of traffic trailer definition:
<pre>
traffic_trailer : traffic.trailer.scs_brick_r
{
trailer_definition: trailer_def.scs.flatbed.single_3.brick
accessories[]: .scs_brick_r.chassis
accessories[]: .scs_brick_r.rwheel
accessories[]: .scs_brick_r.rwheel2
accessories[]: .scs_brick_r.rwheel3
accessories[]: .scs_brick_r.body
accessories[]: .scs_brick_r.paint_job
 
cargo_mass: 20000
 
tags[]: low
tags[]: flatbed
tags[]: brick
tags[]: medium
tags[]: cargo
tags[]: construct
 
cargoes[]: fertilizer
cargoes[]: bricks
cargoes[]: outdr_flr_tl
cargoes[]: plant_substr
}
 
vehicle_accessory: .scs_brick_r.chassis
{
data_path: "/def/vehicle/trailer/scs_brick/red.sii"
}
 
vehicle_wheel_accessory: .scs_brick_r.rwheel
{
offset: 0
data_path: "/def/vehicle/t_wheel/single_385_55_steel.sii"
}
 
vehicle_wheel_accessory: .scs_brick_r.rwheel2
{
offset: 2
data_path: "/def/vehicle/t_wheel/single_385_55_steel.sii"
}
Each method requires different locators within the cargo modelvehicle_wheel_accessory:.scs_brick_r.rwheel3{* '''''direct''''' offset: requires locators with naming4 data_path: <code>lash_d_X<"/def/vehicle/code> where <code>X<t_wheel/code> is incremental index from 0 to 99single_385_55_steel.sii"}vehicle_accessory: . As soon model locator for given index is not found rest will be ignoredscs_brick_r. Lashing will be done in the direction of model locator forward axis, game will pick closest possible lashing mount placement from the body{ data_path: "/def/vehicle/trailer/scs_brick/accessory/body.sii"* '''''top_over'''''}vehicle_paint_job_accessory: requires lashing rail locators with naming.scs_brick_r.paint_job{ data_path: <code>lash_s_Z_X<"/def/vehicle/trailer/code> and <code>lash_e_Z_X<scs_brick/code> where <code>Z<custom_paint_job/code> donates index of multiple rails along model forward axis and <code>Xred.sii"}</codepre> donates index of multiple rails along model X axis. Multiple rails are usually used when there is some obstruction in the model and you need manual dividing into multiple railing (e.g. some separation elements). In all other cases one should use single Z rail indexing since the game will place multiple lashings on the distance of 1.25m from each other. X indexing should be done from left to the right (from -X to +X in model space)
86
edits