{"name":"BIS_fnc_planeEjection","operator":null,"title":"BIS fnc planeEjection","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_planeEjection","revid":376186,"updated":"2025-09-13T15:54:41Z","groups":["Aircraft Functionality"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.70"}],"since":{"game":"arma3","name":"Arma 3","version":"1.70"},"arma3_since":"1.70","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":"spawn","description":"- This function is designed to implement semi-authenthic ejection system on fixed wing aircrfat that have such functionality enabled/configured.","syntaxes":[{"syntax":"[plane, delay] spawn BIS_fnc_planeEjection","since":null,"effect":null,"exec":null,"params":[{"name":"plane","type":"Object","optional":false,"default":null,"description":"living vehicle with a pilot and with ejection systems set up in its config","types":["Object"],"since":null,"text":"plane: Object - living vehicle with a pilot and with ejection systems set up in its config"},{"name":"delay","type":"Number","optional":true,"default":"-1","description":"delay in seconds between function execution and when the ejection actually happens. 0 or lower means no delay.","types":["Number"],"since":null,"text":"delay: Number - (Optional, default -1) delay in seconds between function execution and when the ejection actually happens. 0 or lower means no delay."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"}}],"examples":[{"text":"```sqf\n[_plane, 2] spawn BIS_fnc_planeEjection;\n```","code":["[_plane, 2] spawn BIS_fnc_planeEjection;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_planeAiEject","BIS_fnc_planeEjectionFX","BIS_fnc_ejectionSeatRelease"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Aircraft Functionality","Functions","Introduced with Arma 3 version 1.70"],"docblock":{"author":"Bravo Zero One development, John_Spartan","description":"- This function is designed to implement semi-authenthic ejection system on fixed wing aircrfat that have such functionality enabled/configured.","params":[{"index":0,"name":"mode","types":["Number"],"optional":false,"default":null,"description":"(Scalar)","text":"(Scalar)"},{"index":0,"name":null,"types":[],"optional":false,"default":null,"description":"plane/object\nother parameters are gathered from configuration files.","text":"plane/object\nother parameters are gathered from configuration files."}],"returns":{"types":["Nothing"],"text":"nothing\nPilot will be ejected from aircraft. Semi-authenthic behaviour."},"examples":[],"syntax":null,"execution":"- Call the function via user action added to the aircrfat itself.\n\n        class Plane_Eject_UserActionExample\n        {\n            priority = 0.05;\n            shortcut = \"Eject\";\n            displayName = \"$STR_A3_action_eject\";\n            condition = \"player in this\";\n            statement = \"[this] spawn BIS_fnc_planeEjection\";\n            position = \"pilotcontrol\";\n            radius = 10;\n            onlyforplayer = 1;\n            showWindow = 0;\n                    hideOnUse = 1;\n        };","notes":null,"requirements":"- Compatible aircrfat must have a config definition for all sub-sytems that will be invoked by this function.\n    1. Old legacy ejection must be disabled in aircrfat's cfgVehicles configuration.\n    driverCanEject = 0;\n    gunnerCanEject = 0;\n    cargoCanEject = 0;\n\n    2. Aircrfat must have a set of parameters defined in CfgVehicles subClass (EjectionSystem) for ejection system. Theese parameters will affect the ejection behaviour.\n    example of cfgVehicles subclass definitions;\n\n    class EjectionSystem\n    {\n        EjectionSeatEnabled = 1;                                        //enable advanced ejection system\n        EjectionDual = 0;                                            //currently only single seat aircraft ejectiion supported (to do for latter)\n        EjectionSeatClass = \"B_Ejection_Seat_Plane_Fighter_01_F\";                                //class name of ejector seat to use (separate vehicle/object)\n        CanopyClass = \"Plane_Fighter_01_Canopy_F\";                                //class name of canopy to use (separate vehicle/object)\n        EjectionSeatHideAnim = \"ejection_seat_hide\";                                //name of the hide animation that will hide ejector seat mesh in plane\n        EjectionSeatRailAnim = \"ejection_seat_motion\";                                //name of the animation that will be played to start a smooth ejection motion out of cockpit\n        CanopyHideAnim = \"canopy_hide\";                                        //name of the hide animation that will hide canopy mesh in plane\n        EjectionSeatPos = \"pos_eject\";                                        //position memory point whwre to attach ejector seat\n        CanopyPos = \"pos_eject_canopy\";                                        //position memory point where to attach dummy canopy\n        EjectionSoundExt = \"Plane_Fighter_01_ejection_ext_sound\";                        //sound to play when ejection trigered (external)\n        EjectionSoundInt = \"Plane_Fighter_01_ejection_in_sound\";                        //sound to play when ejection trigered (in-ternal)\n        EjectionParachute = \"Steerable_Parachute_F\";                                //class name parachute used in ejection\n        EjectionSeatForce = 50;                                            //ejection seat blast force\n        CanopyForce = 30;                                            //canopy bast force\n\n    };\n\n    3. Aircrfat model must have momory points definig positions where to attach new vehicle ejector seat, new vehicle canopy.\n    4. Aircrfat model (in model cfg & class AnimationSources) must have a set of hide animations defined to hide ejector seat and canopy in model when new seaparate vehicles are spawned.\n\n    In model.cfg\n    class canopy_hide\n    {\n        type=\"hide\";\n        source=\"user\";\n        selection=\"canopy_hide\";\n        minValue = 0.0;\n        maxValue = 1.0;\n        minPhase = 0.0;\n        maxPhase = 1.0;\n        initPhase = 0;\n        hideValue = 0.001;\n    };\n\n    class ejection_seat_hide\n    {\n        type=\"hide\";\n        source=\"user\";\n        selection=\"ejection_seat\";\n        minValue = 0.0;\n        maxValue = 1.0;\n        minPhase = 0.0;\n        maxPhase = 1.0;\n        initPhase = 0;\n        hideValue = 0.001;\n    }\n\n    In cfgVehicles >> class AnimationSources\n    class canopy_hide\n    {\n        source = \"user\";\n        animPeriod = 0.001;\n        initPhase = 0;\n    };\n\n    class ejection_seat_hide\n    {\n        source = \"user\";\n        animPeriod = 0.001;\n        initPhase = 0;\n    };\n\n    5. Aircrfat model must have an animation for initial ejection stage, where new ejector seat with pilot is pushed gradualy out of cockpit (done to avaoid PhysX colisions and make this feature look good, rathre than spawnig ejetor seat above plane).\n    New ejector seat with pilot will be attached to this animation (via animated meory point).\n    Memory point EjectionSeatPos must be part of this animated selection.\n\n    In model.cfg\n    class ejection_seat_motion\n    {\n        type = \"translation\";\n        source = \"user\";\n        selection = \"ejection_seat\";\n        begin = \"tns_ejection_seat\";\n        end = \"tns_ejection_seat_e\";\n        animPeriod = 0;\n        memory = 1;\n        minValue = 0.0;\n        maxValue = 1.0;\n        offset0 = 0.0;\n        offset1 = 3.0;\n    };\n\n    In cfgVehicles >> class AnimationSources\n    class ejection_seat_motion\n    {\n        source = \"user\";\n        animPeriod = 0.25;\n        initPhase = 0;\n    };\n\n    6. Ejector seat and canopy must be created/defined as separate objects. Can be reused.","meta":{},"text":"Author: Bravo Zero One development\n- John_Spartan\n\nDescription:\n- This function is designed to implement semi-authenthic ejection system on fixed wing aircrfat that have such functionality enabled/configured.\n\nExucution:\n- Call the function via user action added to the aircrfat itself.\n\n        class Plane_Eject_UserActionExample\n        {\n            priority = 0.05;\n            shortcut = \"Eject\";\n            displayName = \"$STR_A3_action_eject\";\n            condition = \"player in this\";\n            statement = \"[this] spawn BIS_fnc_planeEjection\";\n            position = \"pilotcontrol\";\n            radius = 10;\n            onlyforplayer = 1;\n            showWindow = 0;\n                    hideOnUse = 1;\n        };\n\nRequirments:\n- Compatible aircrfat must have a config definition for all sub-sytems that will be invoked by this function.\n    1. Old legacy ejection must be disabled in aircrfat's cfgVehicles configuration.\n    driverCanEject = 0;\n    gunnerCanEject = 0;\n    cargoCanEject = 0;\n\n    2. Aircrfat must have a set of parameters defined in CfgVehicles subClass (EjectionSystem) for ejection system. Theese parameters will affect the ejection behaviour.\n    example of cfgVehicles subclass definitions;\n\n    class EjectionSystem\n    {\n        EjectionSeatEnabled = 1;                                        //enable advanced ejection system\n        EjectionDual = 0;                                            //currently only single seat aircraft ejectiion supported (to do for latter)\n        EjectionSeatClass = \"B_Ejection_Seat_Plane_Fighter_01_F\";                                //class name of ejector seat to use (separate vehicle/object)\n        CanopyClass = \"Plane_Fighter_01_Canopy_F\";                                //class name of canopy to use (separate vehicle/object)\n        EjectionSeatHideAnim = \"ejection_seat_hide\";                                //name of the hide animation that will hide ejector seat mesh in plane\n        EjectionSeatRailAnim = \"ejection_seat_motion\";                                //name of the animation that will be played to start a smooth ejection motion out of cockpit\n        CanopyHideAnim = \"canopy_hide\";                                        //name of the hide animation that will hide canopy mesh in plane\n        EjectionSeatPos = \"pos_eject\";                                        //position memory point whwre to attach ejector seat\n        CanopyPos = \"pos_eject_canopy\";                                        //position memory point where to attach dummy canopy\n        EjectionSoundExt = \"Plane_Fighter_01_ejection_ext_sound\";                        //sound to play when ejection trigered (external)\n        EjectionSoundInt = \"Plane_Fighter_01_ejection_in_sound\";                        //sound to play when ejection trigered (in-ternal)\n        EjectionParachute = \"Steerable_Parachute_F\";                                //class name parachute used in ejection\n        EjectionSeatForce = 50;                                            //ejection seat blast force\n        CanopyForce = 30;                                            //canopy bast force\n\n    };\n\n    3. Aircrfat model must have momory points definig positions where to attach new vehicle ejector seat, new vehicle canopy.\n    4. Aircrfat model (in model cfg & class AnimationSources) must have a set of hide animations defined to hide ejector seat and canopy in model when new seaparate vehicles are spawned.\n\n    In model.cfg\n    class canopy_hide\n    {\n        type=\"hide\";\n        source=\"user\";\n        selection=\"canopy_hide\";\n        minValue = 0.0;\n        maxValue = 1.0;\n        minPhase = 0.0;\n        maxPhase = 1.0;\n        initPhase = 0;\n        hideValue = 0.001;\n    };\n\n    class ejection_seat_hide\n    {\n        type=\"hide\";\n        source=\"user\";\n        selection=\"ejection_seat\";\n        minValue = 0.0;\n        maxValue = 1.0;\n        minPhase = 0.0;\n        maxPhase = 1.0;\n        initPhase = 0;\n        hideValue = 0.001;\n    }\n\n    In cfgVehicles >> class AnimationSources\n    class canopy_hide\n    {\n        source = \"user\";\n        animPeriod = 0.001;\n        initPhase = 0;\n    };\n\n    class ejection_seat_hide\n    {\n        source = \"user\";\n        animPeriod = 0.001;\n        initPhase = 0;\n    };\n\n    5. Aircrfat model must have an animation for initial ejection stage, where new ejector seat with pilot is pushed gradualy out of cockpit (done to avaoid PhysX colisions and make this feature look good, rathre than spawnig ejetor seat above plane).\n    New ejector seat with pilot will be attached to this animation (via animated meory point).\n    Memory point EjectionSeatPos must be part of this animated selection.\n\n    In model.cfg\n    class ejection_seat_motion\n    {\n        type = \"translation\";\n        source = \"user\";\n        selection = \"ejection_seat\";\n        begin = \"tns_ejection_seat\";\n        end = \"tns_ejection_seat_e\";\n        animPeriod = 0;\n        memory = 1;\n        minValue = 0.0;\n        maxValue = 1.0;\n        offset0 = 0.0;\n        offset1 = 3.0;\n    };\n\n    In cfgVehicles >> class AnimationSources\n    class ejection_seat_motion\n    {\n        source = \"user\";\n        animPeriod = 0.25;\n        initPhase = 0;\n    };\n\n    6. Ejector seat and canopy must be created/defined as separate objects. Can be reused.\n\nParameter(s):\n    _this select 0: mode (Scalar)\n    0: plane/object\n\n    other parameters are gathered from configuration files.\n\nReturns: nothing\nResult: Pilot will be ejected from aircraft. Semi-authenthic behaviour."},"filled_from_docblock":["description"]}