Difference between revisions of "Documentation/Engine/Units/accessory cabin data"

From SCS Modding Wiki
Jump to navigation Jump to search
(New documentation for accessory_cabin_data. SCS guys please double-check LOD explanation and toll_tag.)
 
m (Attributes)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The '''accessory_cabin_data''' unit configures the models for the cabin of the [[Documentation/Engine/Game_data/Player_trucks_definitions|player's vehicle]]. Units of this type are found in '''/def/vehicle/truck/<make.model>/cabin/'''.
+
The '''accessory_cabin_data''' unit class configures the models for the cabin of the [[Documentation/Engine/Game_data/Player_trucks_definitions|player's vehicle]]. Units of this type are found in '''/def/vehicle/truck/<brand.model>/cabin/'''.
  
 
== Attributes ==
 
== Attributes ==
Line 6: Line 6:
 
!Name
 
!Name
 
![[Documentation/Engine/Units#Attribute_types|Type]]
 
![[Documentation/Engine/Units#Attribute_types|Type]]
!Required/Optional
+
!Default Value
 
!Description
 
!Description
 
|-
 
|-
 
|detail_model
 
|detail_model
 
|string
 
|string
|optional
+
|
|Path to the high level-of-detail mesh. This is generally unused, but can be used for fine detail or ‘expensive’ shader effects that are only visible very close to the vehicle.
+
|Path to the detailed mesh model descriptor (.pmd). This is used only for vehicles used by player. Additionally they are used in vehicle previews & browser windows.
 
|-
 
|-
 
|model
 
|model
 
|string
 
|string
|required
+
|
|Path to the standard level-of-detail mesh. If only a single LOD is used, it should be set up as '''model''', and the other attributes (detail_model, lods) should not be defined.
+
|Path to the model descriptor (.pmd). If only a single LOD is used, it should be set up as '''model''', and the other attributes (detail_model, lods) should not be defined.
 
|-
 
|-
 
|lods
 
|lods
|string array
+
|array<string>
|optional
+
|
|Paths to the reduced level-of-detail meshes, in order of increasing viewing distance (decreasing model complexity).
+
|Paths to the reduced level-of-detail model descriptors (.pmd), in order of increasing viewing distance (decreasing model complexity).
 
|-
 
|-
 
|collision
 
|collision
 
|string
 
|string
|optional
+
|
|Path to the collision mesh (.pmc).
+
|Path to the collision descriptor (.pmc).
 
|-
 
|-
 
|variant
 
|variant
 
|token
 
|token
|optional*
+
|
 
|Selects the variant to be used for all models/collisions defined. This is required if the cabin and chassis share a model as is currently the standard practice in ETS2 and ATS. Default value is ''default''.
 
|Selects the variant to be used for all models/collisions defined. This is required if the cabin and chassis share a model as is currently the standard practice in ETS2 and ATS. Default value is ''default''.
 
{{Note|All models defined for this '''accessory_cabin_data''' must have this variant name.}}
 
{{Note|All models defined for this '''accessory_cabin_data''' must have this variant name.}}
Line 37: Line 37:
 
|variant_uk
 
|variant_uk
 
|token
 
|token
|optional
+
|
 
|Selects the variant to be used for all models/collisions for right-hand-drive (RHD) vehicles. If unset, defaults to the same value as '''variant'''.
 
|Selects the variant to be used for all models/collisions for right-hand-drive (RHD) vehicles. If unset, defaults to the same value as '''variant'''.
 
{{Note|All models defined for this '''accessory_cabin_data''' must have this variant name.}}
 
{{Note|All models defined for this '''accessory_cabin_data''' must have this variant name.}}
Line 43: Line 43:
 
|look
 
|look
 
|token
 
|token
|optional
+
|
 
|Selects the look to be used for all models defined. Default value is ''default''.
 
|Selects the look to be used for all models defined. Default value is ''default''.
 
{{Note|All models defined for this '''accessory_cabin_data''' must have this look name.}}
 
{{Note|All models defined for this '''accessory_cabin_data''' must have this look name.}}
Line 49: Line 49:
 
|wiper_model
 
|wiper_model
 
|string
 
|string
|optional
+
|
 
|Path to the animated wiper model (.pmg)
 
|Path to the animated wiper model (.pmg)
 
|-
 
|-
 
|wiper_anim
 
|wiper_anim
 
|resource_tie
 
|resource_tie
|optional
+
|
 
|Path to the wiper animation (.pma)
 
|Path to the wiper animation (.pma)
 
|-
 
|-
 
|wiper_model_uk
 
|wiper_model_uk
 
|string
 
|string
|optional
+
|
 
|Path to the animated wiper model (.pmg) for RHD vehicles. If unset, defaults to the value of '''wiper_model'''.
 
|Path to the animated wiper model (.pmg) for RHD vehicles. If unset, defaults to the value of '''wiper_model'''.
 
|-
 
|-
 
|wiper_anim_uk
 
|wiper_anim_uk
 
|resource_tie
 
|resource_tie
|optional
+
|
 
|Path to the wiper animation (.pma) for RHD vehicles. If unset, defaults to the value of '''wiper_anim'''.
 
|Path to the wiper animation (.pma) for RHD vehicles. If unset, defaults to the value of '''wiper_anim'''.
 
|-
 
|-
 
|drl_with_headlights
 
|drl_with_headlights
 
|float
 
|float
|optional
+
|0.0
 
|Sets the relative strength of the daytime running lights when the headlights are on. For the DRL to be ''off'' when the headlights are on, a value of 0 is used. If the DRL should stay on and not dim when the headlights are on, a value of 1 is used. An intermediate value will dim the DRL when the headlights are on, and a value greater than 1 will intensify the DRL when the headlights are on. The typical value in ETS2 is 0.4.
 
|Sets the relative strength of the daytime running lights when the headlights are on. For the DRL to be ''off'' when the headlights are on, a value of 0 is used. If the DRL should stay on and not dim when the headlights are on, a value of 1 is used. An intermediate value will dim the DRL when the headlights are on, and a value greater than 1 will intensify the DRL when the headlights are on. The typical value in ETS2 is 0.4.
 +
<!--
 
|-
 
|-
 
|toll_tag
 
|toll_tag
 
|string
 
|string
|optional
+
|
 
|Currently unused.
 
|Currently unused.
 +
-->
 
|-
 
|-
 
|suspension
 
|suspension
 
|bool
 
|bool
|required
+
|true
 
|When true, physical simulation of cabin air suspension is enabled.
 
|When true, physical simulation of cabin air suspension is enabled.
 +
|-
 +
|suspension_type
 +
|token
 +
|4air
 +
|Defines type of cabin suspension if suspension is enabled. possible values are ''4air'' (EU type) and ''hinge2air''(US type). ''Added in 1.47''
 +
|-
 +
|sounds
 +
|array&lt;string&gt;
 +
|
 +
|Each item assigns an FMOD event to a function, using the "''<nowiki>sound_name|sound_path</nowiki>''" [[Games/ETS2/Modding_guides/1.39#Accessories|format]]. ''Added in 1.39''
 +
 +
Expected sound event names are: horn, aero_noise, and rain_noise.
 
|}
 
|}
 
== Raw Unit Definition ==
 
<pre style="max-height:300px;overflow:auto">  "accessory_cabin_data":{
 
  "superclass":"accessory_data",
 
  "attrs":{
 
    "name":{
 
    "type": "string"
 
    },
 
    "short_name":{
 
    "type": "string"
 
    },
 
    "icon":{
 
    "type": "string"
 
    },
 
    "info":{
 
    "type": "string_array"
 
    },
 
    "price":{
 
    "type": "s64"
 
    },
 
    "unlock":{
 
    "type": "uint"
 
    },
 
    "suitable_for":{
 
    "type": "string_array"
 
    },
 
    "conflict_with":{
 
    "type": "string_array"
 
    },
 
    "defaults":{
 
    "type": "string_array"
 
    },
 
    "require":{
 
    "type": "token_array"
 
    },
 
    "detail_model":{
 
    "type": "string"
 
    },
 
    "model":{
 
    "type": "string"
 
    },
 
    "lods":{
 
    "type": "string_array"
 
    },
 
    "collision":{
 
    "type": "string"
 
    },
 
    "variant":{
 
    "type": "token"
 
    },
 
    "variant_uk":{
 
    "type": "token"
 
    },
 
    "look":{
 
    "type": "token"
 
    },
 
    "wiper_model":{
 
    "type": "string"
 
    },
 
    "wiper_anim":{
 
    "type": "resource_tie"
 
    },
 
    "wiper_model_uk":{
 
    "type": "string"
 
    },
 
    "wiper_anim_uk":{
 
    "type": "resource_tie"
 
    },
 
    "drl_with_headlights":{
 
    "type": "float"
 
    },
 
    "toll_tag":{
 
    "type": "string"
 
    },
 
    "suspension":{
 
    "type": "bool"
 
    }
 
  }
 
  },</pre>
 

Latest revision as of 05:57, 26 May 2023

The accessory_cabin_data unit class configures the models for the cabin of the player's vehicle. Units of this type are found in /def/vehicle/truck/<brand.model>/cabin/.

Attributes

Many common attributes are inherited from accessory_data.

Name Type Default Value Description
detail_model string Path to the detailed mesh model descriptor (.pmd). This is used only for vehicles used by player. Additionally they are used in vehicle previews & browser windows.
model string Path to the model descriptor (.pmd). If only a single LOD is used, it should be set up as model, and the other attributes (detail_model, lods) should not be defined.
lods array<string> Paths to the reduced level-of-detail model descriptors (.pmd), in order of increasing viewing distance (decreasing model complexity).
collision string Path to the collision descriptor (.pmc).
variant token Selects the variant to be used for all models/collisions defined. This is required if the cabin and chassis share a model as is currently the standard practice in ETS2 and ATS. Default value is default.

Note: All models defined for this accessory_cabin_data must have this variant name.

variant_uk token Selects the variant to be used for all models/collisions for right-hand-drive (RHD) vehicles. If unset, defaults to the same value as variant.

Note: All models defined for this accessory_cabin_data must have this variant name.

look token Selects the look to be used for all models defined. Default value is default.

Note: All models defined for this accessory_cabin_data must have this look name.

wiper_model string Path to the animated wiper model (.pmg)
wiper_anim resource_tie Path to the wiper animation (.pma)
wiper_model_uk string Path to the animated wiper model (.pmg) for RHD vehicles. If unset, defaults to the value of wiper_model.
wiper_anim_uk resource_tie Path to the wiper animation (.pma) for RHD vehicles. If unset, defaults to the value of wiper_anim.
drl_with_headlights float 0.0 Sets the relative strength of the daytime running lights when the headlights are on. For the DRL to be off when the headlights are on, a value of 0 is used. If the DRL should stay on and not dim when the headlights are on, a value of 1 is used. An intermediate value will dim the DRL when the headlights are on, and a value greater than 1 will intensify the DRL when the headlights are on. The typical value in ETS2 is 0.4.
suspension bool true When true, physical simulation of cabin air suspension is enabled.
suspension_type token 4air Defines type of cabin suspension if suspension is enabled. possible values are 4air (EU type) and hinge2air(US type). Added in 1.47
sounds array<string> Each item assigns an FMOD event to a function, using the "sound_name|sound_path" format. Added in 1.39

Expected sound event names are: horn, aero_noise, and rain_noise.