Arma 3 Scripting

BIS_fnc_destroyer01Init

  • Global effect
  • Arma 3 v1.84

Function · Markdown · JSON · original wiki page

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. The 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.

The parts are read from the base class's multiStructureParts[] config array, where each entry has the format { "partClassName", "memoryPointName" }. For each entry the function:

Finally it stores the created parts on the base object as the public variable "bis_carrierParts", format [[part, memoryPointName], ...], which the other destroyer functions read.

Syntax

[ship] call BIS_fnc_destroyer01Init

Parameters:

Returns: Nothing

Examples

Example 1

Event handlers of the ship's base class:

class EventHandlers
{
    init = "_this call BIS_fnc_Destroyer01Init";
    AttributesChanged3DEN = "_this call BIS_fnc_Destroyer01EdenInit";
    Dragged3DEN = "_this call BIS_fnc_Destroyer01PosUpdate";
    RegisteredToWorld3DEN = "_this call BIS_fnc_Destroyer01EdenInit";
    UnregisteredFromWorld3DEN = "_this call BIS_fnc_Destroyer01EdenDelete";
};

Example 2

Get the parts created by the function (server only):

private _parts = myDestroyer getVariable ["bis_carrierParts", []];
{
    _x params ["_part", "_memoryPoint"];
    systemChat format ["%1 at %2", typeOf _part, _memoryPoint];
} forEach _parts;

See also

BIS_fnc_destroyer01EdenInit · BIS_fnc_destroyer01PosUpdate · BIS_fnc_destroyer01EdenDelete · BIS_fnc_destroyer01GetShipPart · BIS_fnc_carrier01Init