Skip to content

Part Default Installation Handler

Ferdinand Calo edited this page Jul 14, 2021 · 19 revisions
# Installation Handler Overview
Name: Default Installation Handler
Function: adds the ability to install parts in the old scheme
From FVTM: yes

This Installation handler allows you to setup with which vehicles
your part is compatible, which parts the vehicle needs for this part
to be able to be installed and which part this one cannot be installed with.

If you want the part to be just installable, anywhere, without special
settings, just set "Installation": "default" in the Part config!

You can also set a per-vehicle specific "offset" of where the part will be rendered.

Example config (taken from FVP):

{
    "__comment": "Part JSON file.",
    "Installation": "default"
}
OR
{
    "__comment": "Part JSON file.",
    "Installation": {
        "Handler": "default",
        "Removable": true,
        "CustomCategory": false,
        "Compatible": [
            { "vehicle": "mypack:mycoolcar", "x": 0, "y": 23, "z": 14 },
            { "vehicle": "otherpack:good_truck", "x": 12, "y": 5.6, "z": 19.2 }
        ],
        "Incompatible":[
            { "vehicle": "mypack:mycoolcar", "parts": [ "bumper", "front_deco" ] },
            { "vehicle": "otherpack:good_truck", "parts": [ "some_part_category" ] }
        ],
        "Required": [
            { "vehicle": "mypack:mycoolcar", "parts": [ "lights", "hood" ] }
        ]
    }
}

Here an overview of the available fields:

  • Handler - the id of the wanted handler, it is default
  • Removable - (boolean) optional, if the part can be afterwards removed from the vehicle
  • CustomCategory - (boolean) optional, if the part can be installed into a player specified category
  • Compatible - optional, this is an JSON array with the compatible vehicles and offsets listed
    can be defined in 3 ways (object, array, string)
    • e.g. { "vehicle": "<packid>:<vehicleid>", "x": x, "y": y, "z": z}
      • vehicle - the unique id of the vehicle
      • x - x coordinate of the part, may/can be 0
      • y - y coordinate of the part, may/can be 0
      • z - z coordinate of the part, may/can be 0
      • rx- optional (visual-only) x part rotation
      • ry- optional (visual-only) y part rotation
      • rz- optional (visual-only) z part rotation
    • e.g. [ x, y, z, "<packid>:<vehicleid>"] or [ x, y, z, "<packid>:<vehicleid>", rx, ry, rz ]
      • x - x coordinate of the part, may/can be 0
      • y - y coordinate of the part, may/can be 0
      • z - z coordinate of the part, may/can be 0
      • the unique id of the vehicle
      • rx- optional (visual-only) x part rotation
      • ry- optional (visual-only) y part rotation
      • rz- optional (visual-only) z part rotation
    • e.g. "<packid>:<vehicleid>"
      • just the unique vehicle id as string, with default coordinate of 0, 0, 0
  • Incompatible - optional, this is an list with the incompable parts per vehicle listed
    can be defined in the 3 following ways:
    • e.g.
        "Incompatible":[
          { "vehicle": "<packid>:<vehicleid>", "parts": [ "categories", "here" ] }
        ]
      
      • vehicle - the unique id of the vehicle
      • parts - an string array with incompatible part categories
    • e.g.
        "Incompatible":{
          "<packid>:<vehicleid>": [ "categories", "here" ]
        }
      
      • new shorter way to define incompatible parts
    • e.g.
        "Incompatible":{
          "<packid>:<vehicleid>": "incompatible_category_here"
        }
      
      • new shorter way to define a single incompatible part
  • Required - optional, this is an list with the required parts per vehicle listed
    can be defined in the 3 following ways:
    • e.g.
        "Required":[
          { "vehicle": "<packid>:<vehicleid>", "parts": [ "categories", "here" ] }
        ]
      
      • vehicle - the unique id of the vehicle
      • parts - an string array with required part categories
    • e.g.
        "Required":{
          "<packid>:<vehicleid>": [ "categories", "here" ]
        }
      
      • new shorter way to define required parts
    • e.g.
        "Required":{
          "<packid>:<vehicleid>": "required_category_here"
        }
      
      • new shorter way to define a single required part
  • SwivelPoint - optional, the SwivelPoint this part will be "mounted" on,
    the offset set earlier will apply to the swivel point instead of vehicle, default: vehicle,
    falls back to vehicle if the swivel point is absent
  • SwivelPointRequired - optional, if the specified SwivelPoint is required for
    the part to install into this vehicle, if absent the part will not install
  • SlotBased - optional, if this can be only installed on Part - Slot-Provider-Function slots,
    note: not compatible with "SwivelPoint", slot installed parts automatically install on the
    slot provider's swivel point (if any)
Clone this wiki locally