Jump to content
Quake.

Scripting Pylons and Hardpoints

Recommended Posts

Hello, I am an ArmA veteran who is just getting into scripting, mostly out of necessity, as in a new setting I have a pilot who is currently flying the Gryphon from the AAF Faction, however this is an issue as the Gryphon is very lightly armed and we are having to frequently re-arm to remain combat effective. As such I want to arm Gryphons with heavier armaments and while I am having limited success I seem to have come up against a wall as far as progress is concerned. I have already worked out some basic script to give a Gryphon Two pods of DAGR 70mm Rockets;

this setPylonLoadOut [4, "PylonRack_12Rnd_PG_missiles", true];
this setPylonLoadOut [3, "PylonRack_12Rnd_PG_missiles", true];

However, I now would like to see how I could add a Triple 'PylonPod' of Maverick's ATGM's to Pylon 5, and (if possible) a Dual Pylon of CBU-85 Cluster Bombs to Pylon 6.
There is definitely enough physical space on the aircraft to accompany such weapons, but I just cant seem to find any way to arm them this way.

 

Any help is much appreciated, especially anything that can set me up to do this sort of thing on my own in the future.

Thanks, Dan.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

No I didn't know about that fabulous list of weapons, thank you so very much that's worked perfectly.

Also, You wouldn't happen to know if there's any way to make an aircraft other than the Sentinel or Black Wasp be able to use the arrestor wires. Like a script that could let a Shikra do Carrier landings etc?

Share this post


Link to post
Share on other sites

I'm actually working on a mod related to that subject right now... but through scripting alone ... I don't think so.

For an aircraft to use the tail hook, it needs to have a memory point and tailhook selection defined in the model

See this:

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

Which from the extracted files is this script:

Spoiler

/*
    Author: Bravo Zero One development
    - John_Spartan

    Description:
    Aircrfat carrier arrest/recovery function for USS Freedom aircraft carrier

    Exucution:
    Call the function via user-action or script for any compatible fixed wing aircrfat
    [this] spawn bis_fnc_aircraftTailhook;

    Requirments:
    - Compatible aircrfat must have an animation for arrest/tail hook selection defined in CfgCehicles and modeled in 3D model (model.cfg)
    - Compatible aircrfat must have a memory point for cable attach position

    example of cfgVehicles subclass definitions;

        tailHook = true;                                                                            Allow to land on carrier
        class CarrierOpsCompatability
        {
            ArrestHookAnimationList[] = {"tailhook", "tailhook_door_l", "tailhook_door_r"};            List of animation played to animate tailhook. Defined in model.cfg (type user)
            ArrestHookAnimationStates[] = {0,0.53,1};                                                Tailhook animation states when down, hooked, up.
            ArrestHookMemoryPoint = "pos_tailhook";                                                    TailHook memory point in plane model.p3d
            ArrestMaxAllowedSpeed = 275;                                                            Max speed km/h allowed for successful landing
            ArrestSlowDownStep = 0.8;                                                                Simulation step for calcualting how smooth plane will be slowed down.
            ArrestVelocityReduction = -12;                                                            Speed reduced per simulation step

        };

    Parameter(s):
        _this select 0: mode (Scalar)
        0: plane/object


    Returns: nothing
    Result: Aircrfat after touch down on carrier deck will be dynamicly slowed down. If speed willbe above 275 km/h (suggested and configured on vanilla assets) wire snap will be simulated.
        Aircrfat will come to full stop in 155-175 m

*/

#define EXIT_CODE        {_plane animate [_x,_planeHookUpAnimState];} forEach _planeHookAnimList;_plane SetUserMFDvalue [4,0];

private _plane = param [0, objNull];
if (!local _plane) exitWith {};
private _configPath = configFile >> "CfgVehicles" >> typeOf _plane;
private _planeCarrierOpsEnabled = (_configPath >> "tailHook") call BIS_fnc_getCfgData; if (_planeCarrierOpsEnabled == 0) exitWith {};
private _planeHookAnimList = (_configPath >> "CarrierOpsCompatability" >> "ArrestHookAnimationList") call BIS_fnc_getCfgData;
private _arrestMaxAllowedSpeed = (_configPath >> "CarrierOpsCompatability" >> "ArrestMaxAllowedSpeed") call BIS_fnc_getCfgData;
private _arrestSlowDownStep = (_configPath >> "CarrierOpsCompatability" >> "ArrestSlowDownStep") call BIS_fnc_getCfgData;
private _arrestVelocityReduction = (_configPath >> "CarrierOpsCompatability" >> "ArrestVelocityReduction") call BIS_fnc_getCfgData;
private _planeHookAnimStates = (_configPath >> "CarrierOpsCompatability" >> "ArrestHookAnimationStates") call BIS_fnc_getCfgData;
_planeHookAnimStates params ["_planeHookDownAnimState","_planeHookCaughtAnimState","_planeHookUpAnimState"];
private _carrierPart = "Land_Carrier_01_hull_08_1_F";

sleep 2;

private _hookAnim = _planeHookAnimList param [0,"",[""]];
waitUntil{!alive _plane || {_plane animationphase _hookAnim == _planeHookUpAnimState || {getPos _plane select 2 < 1}}};
if (!alive _plane || getPos _plane select 2 > 1) exitWith {EXIT_CODE};

private _objects = _plane nearObjects [_carrierPart, 150]; if (count _objects == 0) exitWith {EXIT_CODE};
private _carrier = _objects param [0, objNull];
private _carrierWirePos = _carrier modelToWorld (_carrier selectionPosition "pos_cable_1");
private _distance = _plane distance2D _carrierWirePos; if (_distance > 75) exitWith {EXIT_CODE};
{_plane animate [_x,_planeHookCaughtAnimState, true];} foreach _planeHookAnimList;

sleep 0.5;
if (speed _plane > _arrestMaxAllowedSpeed ) exitWith {EXIT_CODE; _plane say3D "Land_Carrier_01_wire_snap_sound";};
_plane say3D "Land_Carrier_01_wire_trap_sound";

while {alive _plane && {_plane animationphase _hookAnim != _planeHookUpAnimState && {speed _plane > -10}}} do
{
    _velInitial = velocity _plane;
    _dirPlane = direction _plane;
    _plane setVelocity (_velInitial vectorAdd [sin _dirPlane * _arrestVelocityReduction,cos _dirPlane * _arrestVelocityReduction,0]);

    sleep _arrestSlowDownStep;
    if (_arrestVelocityReduction >= -3) then {_arrestVelocityReduction = -3;} else {_arrestVelocityReduction = _arrestVelocityReduction + 0.1;};
    if (_arrestSlowDownStep <= 0.2) then {_arrestSlowDownStep = 0.03;} else {_arrestSlowDownStep = _arrestSlowDownStep - 0.1;};
};

sleep 2;

if (_plane animationphase _hookAnim == _planeHookUpAnimState) exitWith {};

EXIT_CODE;

//------------------------------------
//Set Steam Archivement state
//------------------------------------
if (canMove _plane && {(isPlayer driver _plane || {(UAVControl _plane) isEqualTo [player,"DRIVER"]})}) then
{
    setStatValue ["JetsGetArrested", 1];
};

 

What I've done in the past for a mission, is to put a trigger linked to a named Shikra, the trigger area was a rectangular area right over the arrestor wires, with a very low height limit, and some conditions for the shikra's heading and velocity (using getDir, getVelocity, etc), so that if that shikra entered the trigger area in a certain speed and heading range, a setvelocity command would execute and lower the speed enough to stop.

 

If you're interested in shikra's landing on carriers... you might be interested in my mod "offshore assault" which I will update soon. I also notice a lack of CSAT options for operating from ships, so I've made a version of the ATLAS LHD with no american insignia or colors stuff, a Xian variant with a much better radar, that can carry up to 12 air to air missiles, a CSAT A-143 buzzard variant that has an arrestor hook, and placeable arrestor wires and aircraft catapults to allow one to turn the no-insignia LHD into a light carrier.

I also added a port of the Vodnik from Arma 2, in CSAT camo, that can be slung load... something to compete with the Marshal and its 40mm cannon being deployed by the blackfish (the vodnik port can be hoisted by the Taru)... although this stuff I mention will be in my next update (aside from the Xian and base LHD)

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

×