Description
Helper function that returns one part of a multi-part ship by its class name. It searches the ship's "bis_carrierParts" variable, which BIS_fnc_destroyer01Init creates on the server.
It is used by the destroyer's Eden Editor attribute expressions (e.g. to pass the hull part to BIS_fnc_destroyer01InitHullNumbers) and can also be used in scripts.
Important
The function only works on the server. On other machines, and when the ship has no parts or no class name is given, it returns Nothing.
If several parts have the same class, the last one in the list is returned.
Syntax
[ship, partClass] call BIS_fnc_destroyer01GetShipPart
Parameters:
ship: Object - the ship's base objectpartClass: String - class name of the part to find, e.g."Land_Destroyer_01_hull_04_F"
Returns: Object - the part, or objNull if the ship has no part of this class
Examples
Example 1
// on the server: open the hangar doors of the destroyer named myDestroyer
private _hull = [myDestroyer, "Land_Destroyer_01_hull_04_F"] call BIS_fnc_destroyer01GetShipPart;
[_hull, 1, false] call BIS_fnc_destroyer01AnimateHangarDoors;
See also
BIS_fnc_destroyer01Init · BIS_fnc_destroyer01InitHullNumbers · BIS_fnc_destroyer01AnimateHangarDoors