Difference between revisions of "Documentation/Engine/Units/trailer def"
< Documentation | Engine | Units
Jump to navigation
Jump to search
(New article, still WIP.) |
(Added 1.28 attributes) |
||
Line 1: | Line 1: | ||
{{Note| WIP — [[User:Smarty|Smarty]] ([[User talk:Smarty|talk]]) 23:22, 21 June 2017 (CEST)}} | {{Note| WIP — [[User:Smarty|Smarty]] ([[User talk:Smarty|talk]]) 23:22, 21 June 2017 (CEST)}} | ||
− | The '''trailer_def''' unit class acts as an intermediary between [[Documentation/Engine/Units/cargo_data|cargo_data]] and [[Documentation/Engine/Units/trailer|trailer]] units. Units of this type are usually defined in '''/def/cargo/<cargo_name>/<trailer_name>.sii''', corresponding to '''def/cargo/<cargo_name>.sii'''. They define which trailer configuration to enable for the cargo, the cargo's mass for that trailer configuration, | + | The '''trailer_def''' unit class acts as an intermediary between [[Documentation/Engine/Units/cargo_data|cargo_data]] and [[Documentation/Engine/Units/trailer|trailer]] units. Units of this type are usually defined in '''/def/cargo/<cargo_name>/<trailer_name>.sii''', corresponding to '''def/cargo/<cargo_name>.sii'''. They define which trailer configuration to enable for the cargo, the cargo's mass for that trailer configuration, how that mass is distributed/placed on the trailer and its slave units, and where the configuration is permitted. |
== Attributes == | == Attributes == | ||
Line 19: | Line 19: | ||
| | | | ||
|The mass of the cargo for this trailer configuration in kilograms (kg). | |The mass of the cargo for this trailer configuration in kilograms (kg). | ||
+ | |- | ||
+ | |length | ||
+ | |uint | ||
+ | |20 | ||
+ | |The approximate length of the trailer combination in meters. When generating a job this is compared against the '''allowed_trailer_length''' of the source and destination depot [[Documentation/Engine/Units/prefab_data|prefabs]] to determine whether this trailer_def is suitable for the job. ''Added in 1.28.'' | ||
+ | |- | ||
+ | |country | ||
+ | |array<token> | ||
+ | | | ||
+ | |Each member is a [[Documentation/Engine/Units/country_data|country]] (state in ATS) where this trailer_def will be suitable for generated jobs. Both the origin and destination of a job must be in the ''country'' array for the trailer_def to be suitable for it. If unset, then the trailer_def is suitable in all countries. ''Added in 1.28.'' | ||
|- | |- | ||
|cog_offset | |cog_offset |
Revision as of 05:15, 21 July 2017
The trailer_def unit class acts as an intermediary between cargo_data and trailer units. Units of this type are usually defined in /def/cargo/<cargo_name>/<trailer_name>.sii, corresponding to def/cargo/<cargo_name>.sii. They define which trailer configuration to enable for the cargo, the cargo's mass for that trailer configuration, how that mass is distributed/placed on the trailer and its slave units, and where the configuration is permitted.
Attributes
Name | Type | Default Value | Description |
---|---|---|---|
trailer | string | The unit name of the trailer unit to be enabled for the cargo. This attribute can safely refer to units which aren't present. | |
mass | float | The mass of the cargo for this trailer configuration in kilograms (kg). | |
length | uint | 20 | The approximate length of the trailer combination in meters. When generating a job this is compared against the allowed_trailer_length of the source and destination depot prefabs to determine whether this trailer_def is suitable for the job. Added in 1.28. |
country | array<token> | Each member is a country (state in ATS) where this trailer_def will be suitable for generated jobs. Both the origin and destination of a job must be in the country array for the trailer_def to be suitable for it. If unset, then the trailer_def is suitable in all countries. Added in 1.28. | |
cog_offset | array<float3> | Each member defines the offset of the cargo center of gravity from the calculated value for each trailer in the trailer configuration, starting with the master trailer and iterating through the slave trailers. (X, Y, Z) corresponds to lateral, vertical, and longitudinal offsets respectively. | |
cargo_mass_ratio | array<float> | cargo_mass_ratio: 1 cargo_mass_ratio[0]: 1 |
Each member defines how much of the cargo mass and forces are borne by each trailer in the trailer configuration, starting with the master trailer and iterating through the slave trailers. |