Jump to content
scottb613

Aircraft MSL instead of AGL Altitude?

Recommended Posts

Hi Folks,

 

I'm trying to setup a decent airborne para drop - I have it working nicely - EXCEPT - for the annoying altitude transitions over terrain.

 

Is there a way to force the aircraft to maintain a level altitude for the para drop?

 

Thanks.

 

Regards,
Scott

Share this post


Link to post
Share on other sites
6 hours ago, TeTeT said:

Hi,

 

when using some tanker AI I had success with combining

https://community.bistudio.com/wiki/flyInHeightASL

and

https://community.bistudio.com/wiki/flyInHeight

 


this flyInHeight 800;
this flyInHeightASL [1000,1000,1000];

 

 

Hi TeTeT,

 

Thank you kindly - let me give that a shot.

🙂

 

Regards,
Scott

Share this post


Link to post
Share on other sites

Hi Folks,

 

Yeah - tried that - I think I'm stuck with the altitude excursions...

 

 

 

One follow up question - if I may - as you can see in the video - the ejection and aircraft perform as expected with AI. When I turn one of the AI jumpers into the "player" - as soon as the player is ejected - the aircraft immediately dives to land at the airport in the shot - regardless of which jumper I choose to use as "player" and regardless of which aircraft I choose to ride - - - instead of following the waypoints to their conclusion.

 

Is there a way to prevent this from happening?

 

Here's my ejection sequence.

 

    _x setVariable ["Saved_Loadout", getUnitLoadout _x];
    removeBackpack _x;
    _x disableCollisionWith _vehicle;
    _x allowDamage false;
    [_x] ordergetin false;  
    [_x] allowGetIn false; 
    unassignVehicle _x;
    moveOut _x;
    _x setDir (_dir + 90);
    _x setVelocity [0, 0, -5];
    sleep 0.5; // Delay between each unit exiting the aircraft.
    [_x, _chuteheight] spawn ParaLandSafe;

  

 

Thanks...

 

Regards,
Scott

Share this post


Link to post
Share on other sites

Are you in the same group of the driver? and btw the leader?

or any condition in waypoint's statements?

  • Like 1

Share this post


Link to post
Share on other sites

Hi Pierre,

 

I think my groupings are good... Alpha on Herc1 - Bravo on Herc2.

 

Image1.jpg

 

Initially - I had the landing issue from when the first AI left the aircraft - the following additions to the code seemed to solve that issue. Again - all AI works perfectly - if the "player" becomes the "Copilot" all works perfectly - only when the "player" leaves the aircraft does the issue occur.

 

    [_x] ordergetin false;  
    [_x] allowGetIn false; 

 

Here's my full ejection script - modded a helo script made by someone else. I've never used or tried the "Cargo" portion of the code. I had intended to remove the "Cargo" portion to suit my needs.

 

Spoiler

/*
    Filename: Simple ParaDrop Script v0.99d land.sqf
    Author: Beerkan

    Description:
    A Simple Paradrop Script that will make assigned units (except crew) exit a vehicle,
    add a parachute, and when landed, respawn their original backpacks.

    Parameters:
    0: VEHICLE  - the vehicle that will be doing the paradrop (object)
    1: ALTITUDE - (optional) the altitude where the group & Cargo Item (if used) will open their parachute (number)
    2: CARGOITEM - (optional) the item, vehicle, or ammocrate you wish to paradrop with the paras. CARGOITEM will also have Virtual Arsenal. (object)

    Example Usage:
    0 = [UH80, 150] execVM "land.sqf"                        - Simple paradrop without cargo.
    0 = [UH80, 150, "B_supplyCrate_F"] execVM "land.sqf"     - Paradrop with cargo.

    Notes:
    - The script generates a random staggered position for each parachutist, up to 10 meters left or right of the aircraft's track.

*/

if (!isServer) exitWith {};

private ["_paras", "_vehicle", "_item"];
_vehicle = _this select 0;
_paras = [];
_crew = crew _vehicle;

// Get everyone except the crew.
{
    _isCrew = assignedVehicleRole _x;
    if (count _isCrew > 0) then
    {
        if ((_isCrew select 0) == "Cargo") then
        {
            _paras pushBack _x;
        };
    };
} forEach _crew;

// Height to auto-open chute, i.e., 120 if not defined.
_chuteheight = if (count _this > 1) then { _this select 1 } else { 120 };

// Cargo to drop, or nothing if not selected.
_item = if (count _this > 2) then { _this select 2 } else { nil };

_vehicle allowDamage false;
_dir = direction _vehicle;

ParaLandSafe =
{
    private ["_unit"];
    _unit = _this select 0;
    _chuteheight = _this select 1;
    (vehicle _unit) allowDamage false;
    
    sleep 0; // Delay the opening of the chute by 2 seconds per unit
    _unit addBackpack "vn_b_pack_t10_01"; // Add parachute

    // Calculate position staggered to the left or right of the track by 10 meters
    private "_stagger";
    _stagger = round(random 10) - 5; // Generates numbers between -10 and 10
    
    _unit setPos [(position _unit select 0) + _stagger, (position _unit select 1) + _stagger, (position _unit select 2)];

    waitUntil { (_unit distance (vehicle _unit) < 5) || (position _unit select 2) < 1 }; // Open chute when close to the vehicle or close to the ground
    _unit action ["openParachute", _unit];
    waitUntil { (_unit distance (vehicle _unit) < 5) || (position _unit select 2) < 1 }; // Wait until they are on the ground
    
    _unit setUnitLoadout (_unit getVariable ["Saved_Loadout", []]);
    _unit allowDamage true;
};

{
    _x setVariable ["Saved_Loadout", getUnitLoadout _x];
    removeBackpack _x;
    _x disableCollisionWith _vehicle;
    _x allowDamage false;
    [_x] ordergetin false;  
    [_x] allowGetIn false; 
    unassignVehicle _x;
    moveOut _x;
    _x setDir (_dir + 90);
    _x setVelocity [0, 0, -5];
    sleep 0.5; // Delay between each unit exiting the aircraft.
    [_x, _chuteheight] spawn ParaLandSafe;
} forEach _paras;

if (!isNil ("_item")) then
{
    _CargoDrop = _item createVehicle getPos _vehicle;
    _CargoDrop allowDamage false;
    _CargoDrop disableCollisionWith _vehicle;
    _CargoDrop setPos [(position _vehicle select 0) - (sin (getDir _vehicle) * 15), (position _vehicle select 1) - (cos (getDir _vehicle) * 15), (position _vehicle select 2)];
    clearMagazineCargoGlobal _CargoDrop;
    clearWeaponCargoGlobal _CargoDrop;
    clearItemCargoGlobal _CargoDrop;
    clearBackpackCargoGlobal _CargoDrop;
    waitUntil {(position _item select 2) <= _chuteheight};
    [objNull, _CargoDrop] call BIS_fnc_curatorObjectEdited;
    _CargoDrop addAction ["<t color='#00FF00'>Open Virtual Arsenal</t>", {["Open", true] call BIS_fnc_arsenal;}];
};

_vehicle allowDamage true;

 

 

I call the script from a WP but I don't think I'm doing anything else that would affect operation.

 

Thanks for the interest.

😉

 

Regards,
Scott

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×