{"name":"BIS_fnc_destroyer01Init","title":"BIS fnc destroyer01Init","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_destroyer01Init","revid":379556,"updated":"2026-10-31T13:49:06Z","groups":["Destroyer"],"status":"ok","games":{"arma3":"1.84"},"since":"arma3 1.84","arma3_since":"1.84","locality":{"effect":"global"},"description":"Main function that assembles a multi-part ship such as the destroyer. The ship's base object is a blank model with memory points; every other part is a separate object that is created and placed on one of these memory points.\nThe function is called by the `init` event handler of the ship's base class and does nothing outside the server. It is not meant to be called from scripts: calling it again creates a second set of parts.\n\nThe parts are read from the base class's `multiStructureParts[]` config array, where each entry has the format `{ \"partClassName\", \"memoryPointName\" }`. For each entry the function:\n\n- creates the part with createVehicle (special \"CAN_COLLIDE\")\n- gives it the base's direction, pitch and bank\n- places it with setPosWorld on the base's memory point\n- disables its damage with allowDamage\n\nFinally it stores the created parts on the base object as the public variable `\"bis_carrierParts\"`, format `[[part, memoryPointName], ...]`, which the other destroyer functions read.","syntaxes":[{"syntax":"[ship] call BIS_fnc_destroyer01Init","params":[{"name":"ship","type":"Object","description":"the ship's base object (the init event handler passes it as `_this`)","type_expr":"Object"}],"returns":{"type":"Nothing","type_expr":"Nothing"}}],"examples":[{"text":"Event handlers of the ship's base class:\n\n```cpp\nclass EventHandlers\n{\n    init = \"_this call BIS_fnc_Destroyer01Init\";\n    AttributesChanged3DEN = \"_this call BIS_fnc_Destroyer01EdenInit\";\n    Dragged3DEN = \"_this call BIS_fnc_Destroyer01PosUpdate\";\n    RegisteredToWorld3DEN = \"_this call BIS_fnc_Destroyer01EdenInit\";\n    UnregisteredFromWorld3DEN = \"_this call BIS_fnc_Destroyer01EdenDelete\";\n};\n```"},{"text":"Get the parts created by the function (server only):\n\n```sqf\nprivate _parts = myDestroyer getVariable [\"bis_carrierParts\", []];\n{\n    _x params [\"_part\", \"_memoryPoint\"];\n    systemChat format [\"%1 at %2\", typeOf _part, _memoryPoint];\n} forEach _parts;\n```","code":["private _parts = myDestroyer getVariable [\"bis_carrierParts\", []];\n{\n\t_x params [\"_part\", \"_memoryPoint\"];\n\tsystemChat format [\"%1 at %2\", typeOf _part, _memoryPoint];\n} forEach _parts;"]}],"see_also":["BIS_fnc_destroyer01EdenInit","BIS_fnc_destroyer01PosUpdate","BIS_fnc_destroyer01EdenDelete","BIS_fnc_destroyer01GetShipPart","BIS_fnc_carrier01Init"],"categories_extra":["Pages with SQF errors"]}