Changes

Jump to navigation Jump to search

Documentation/Engine/Units/accessory data

1,399 bytes removed, 14:02, 20 June 2017
Attributes
The '''accessory_data''' unit class is the superclass for all ''accessory_*_data'' classes and defines basic UI attributes and compatibility/interactions between accessories. It is generally not used explicitly ''directly'' because it doesn't affect the vehicle visually or physically. Instead, more specialized subclasses have been derived from it to define specific accessory types. Basically, think of '''accessory_data''' as a template from which all ''accessory_*_data'' classes have been derived.
== Attributes ==
|-
|info
|string_arrayarray<string>
|
|Additional information about the accessory. Few accessory types still use this for UI display (e.g. engine).
|price
|s64
|0
|The price of the accessory in the store in the base currency (ETS2 → EUR, ATS → USD). If zero, the accessory will not be visible to the player.
|-
|-
|suitable_for
|string_arrayarray<string>
|
|Each array member specifies a unit name — or a pattern using wildcards (*) — which must be present on the vehicle for this accessory to become visible in the store and applicable to the vehicle.
|-
|conflict_with
|string_arrayarray<string>
|
|Each array member specifies a unit name — or a pattern using wildcards (*) — with which this accessory is incompatible. The conflicting accessories will be removed from the vehicle if this accessory is applied.
|-
|defaults
|string_arrayarray<string>
|
|Each array member specifies a path to an accessory definition file which is applied to the vehicle if no other suitable accessory of the same type exists on the vehicle.
|-
|overrides
|array<string>
|
|Each array member specifies a path to an accessory definition file which is applied to the vehicle, overriding other accessories of the same type if one already exists on the vehicle. This eliminates the need for suitable_for/defaults relationships in most cases (e.g. engine badges and sounds). ''(New in ETS 1.27/ATS 1.6)''
|-
|require
|token_arrayarray<token>
|
|Each array member specifies an accessory type that must exist on the vehicle while this accessory is installed. For example, if a truck has separate accessories for mudflaps and mudflap hangers, each hanger accessory might declare <code>require[]: mudflaps</code> to disallow a state where the truck has mudflap hangers but no mudflaps. The token is the final segment of each unit name, so matching accessories would have unit names like <code>foo.bar.mudflaps</code>.
{{Note|Every ''require''d accessory type should '''always''' have a corresponding accessory of that type in ''defaults''!}}
|}
 
== Subclasses ==
*[[Documentation/Engine/Units/accessory_addon_data|accessory_addon_data]]
**[[Documentation/Engine/Units/accessory_addon_int_data|accessory_addon_int_data]]
**[[Documentation/Engine/Units/accessory_addon_patch_data|accessory_addon_patch_data]]
*[[Documentation/Engine/Units/accessory_cabin_data|accessory_cabin_data]]
*[[Documentation/Engine/Units/accessory_cargo_data|accessory_cargo_data]]
*[[Documentation/Engine/Units/accessory_chassis_data|accessory_chassis_data]]
*[[Documentation/Engine/Units/accessory_engine_data|accessory_engine_data]]
*[[Documentation/Engine/Units/accessory_head_lights_data|accessory_head_lights_data]]
*[[Documentation/Engine/Units/accessory_hookup_data|accessory_hookup_data]]
**[[Documentation/Engine/Units/accessory_hookup_int_data|accessory_hookup_int_data]]
**[[Documentation/Engine/Units/accessory_horn_hookup_data|accessory_horn_hookup_data]]
*[[Documentation/Engine/Units/accessory_interior_data|accessory_interior_data]]
*[[Documentation/Engine/Units/accessory_paint_job_data|accessory_paint_job_data]]
*[[Documentation/Engine/Units/accessory_sound_data|accessory_sound_data]]
*[[Documentation/Engine/Units/accessory_transmission_data|accessory_transmission_data]]
*[[Documentation/Engine/Units/accessory_truck_data|accessory_truck_data]]
*[[Documentation/Engine/Units/accessory_rim_data|accessory_rim_data]]
*[[Documentation/Engine/Units/accessory_wheel_data|accessory_wheel_data]]
 
{{UnitDef|def=<nowiki> "accessory_data":{
"superclass":"unit",
"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"
}
}
},</nowiki>}}

Navigation menu