Jump to content
Sign in to follow this  
glass32b

Helicopter Crash recovery

Recommended Posts

Hello out there,
 
I am new to the whole Arma 3 editing.  so far it has been very interseting building my own missions and its very fun to play other people's missions as well. 
So a friend and I are trying to create the PB we lived on when we were in Afghanistan it took a good while but we finally finished it.  Now we want to make some great missions but everytime we think of something we hit major walls because we have no idea what we are doing. 
 
So the mission is that you get ambushed in a city you then make your way to a clear exfill.  we have a helo extraction module for a transport request to be able to RTB.  when you call it in the helo flies over 8 AA infantry and most of the time the bird just crash lands but does not blow. 
 
what we want to see is this bird crash and as it crashes to the ground enemy forces are then triggered to secure the site. 
 
I would create a trigger so as the helicopter passes over the trigger it would sync with soldiers to preplanned waypoints.  the thing is that when this helicopter gets hit, it can land almost anywhere in a 3 square mile radius.  Plus sometimes the helo does not die.  I created a trigger with !alive joker command but when the bird safley lands after taking the hits the trigger never gets activated.  
 
So all in all I need to have enemies close in on a down helicopter and I want to be able to trigger the helo crashing with a hint.
 
Thanks in Advance.  
If you need to get a hold of my map please let me know.

Share this post


Link to post
Share on other sites

Hi.

 

Instead of digging in editor put in joker heli init field :

nul = [this] execVM "crash.sqf";
this addAction["<t color='#ff9900'>Repair JOKER</t>",{
    _unit = _this select 1;
    _unit playMove "AinvPknlMstpSnonWnonDnon_medic_1";
    sleep 9;
    joker setDammage 0;
},[],6,false,true,"","alive joker && ((getDammage joker) > 0.1) && (_target distance _this) < 5"];

Then create file   crash.sqf  in mission root directory.

    private ["_joker", "_jokerGrp", "_crashsite", "_newpos", "_marker", "_marker2", "_enemyposition", "_enemygroup", "_enemygroup2", "_vehicles", "_trg", "_trg2", "_wp", "_landpos"];

    _joker = _this select 0;
    _jokerGrp = group _joker;
    waitUntil {(getDammage _joker) > 0.5 AND (alive _joker) AND (speed _joker) > 1};

    _joker allowDamage false;
    _joker setCaptive true;
    _joker setFuel 0;
    waitUntil {(getPos _joker select 2) < 2 AND (speed _joker) < 1};
    _crashsite = getPos _joker;
    _newpos = [getpos _joker, 20, 100, 15, 0, 0, 0] call BIS_fnc_findSafePos;
    _joker setPos _newpos;


    {  
        doGetOut _x;
    } forEach units _jokerGrp;
        
    {  
        _x disableAI "MOVE";
        removeAllWeapons _x;
        _x setCaptive true;
        _x allowDamage false;
    
    } forEach units _jokerGrp;

    _marker = createMarker ["crashsite", _crashsite];
    _marker setMarkerShape "ellipse";
    _marker setMarkerColor "ColorRed";
    _marker setMarkerSize [500,500];
    _marker2 = createMarker ["vehrepair", _newpos];
    _marker2 setMarkerType "b_air";
    _marker2 setMarkerColor "ColorBlue";
    _marker2 setMarkerText "Damaged Chopper";
    _marker2 setMarkerSize [1,1];
    

    [
        west,
        "crashsite",
        [
            "Enemy attacking our crashed helicopter to capture the crew.",
            "Defend crash side",
            "crashsite"
        ],
        _crashsite,
        true
    ] call BIS_fnc_taskCreate;
    
    ["crashsite", "CREATED",true] spawn BIS_fnc_taskSetState;

    
    sleep 20;
    
    waitUntil {({isPlayer _x AND (_x distance _joker) < 800} count (playableUnits + switchableUnits)) != 0};

    
        _enemyposition = [getMarkerPos _marker, 250, 450, 10, 0, 0, 0] call BIS_fnc_findSafePos;
    
    
        _enemygroup = [_enemyposition, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad_Weapons")] call BIS_fnc_spawnGroup;
        [_enemygroup,getMarkerPos _marker, 200] call BIS_fnc_taskPatrol;
    
        _enemygroup2 = [_enemyposition, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad_Weapons")] call BIS_fnc_spawnGroup;
        [_enemygroup2,getMarkerPos _marker, 100] call BIS_fnc_taskPatrol;
    
        _vehicles = createGroup EAST;
        [_enemyposition, 10, "O_MRAP_02_hmg_F", _vehicles] call BIS_fnc_spawnvehicle;
        [_vehicles,getMarkerPos _marker, 100] call BIS_fnc_taskPatrol;
    
        _trg = createTrigger ["EmptyDetector", getMarkerPos "crashsite"];
        _trg setTriggerArea [600, 600, 0, false];
        _trg setTriggerActivation ["EAST", "NOT PRESENT", false];
        _trg setTriggerStatements ["this", "", ""];

 
        waitUntil {triggerActivated _trg};

        ["crashsite", "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
        sleep 5;
        PAPABEAR = [West,"HQ"];
        PAPABEAR sideChat "Crash site is secure. Good job soldiers!";
    
        _joker setCaptive false;

        sleep 5;
        deleteMarker _marker;
        {deleteVehicle _x} forEach units _enemygroup;
        deleteGroup _enemygroup;
        {deleteVehicle _x} forEach units _enemygroup2;
        deleteGroup _enemygroup2;
        {deleteVehicle _x} forEach units _vehicles;
        deleteGroup _vehicles;
        
        _trg2 = createTrigger ["EmptyDetector", getMarkerPos "b_air"];
        _trg2 setTriggerArea [1, 1, 0, false];
        _trg2 setTriggerActivation ["NONE", "PRESENT", false];
        _trg2 setTriggerStatements ["(getDammage joker) < 0.1", "joker setFuel 1;", ""];
    
        [
            west,
            "vehrepair",
            [
                "Repair Chopper at crash site.",
                "Repair Chopper",
                "vehrepair"
            ],
            (getPosATL _joker),
            true
        ] call BIS_fnc_taskCreate;
    
        ["vehrepair", "CREATED",true] spawn BIS_fnc_taskSetState;
    
        waitUntil {triggerActivated _trg2};

        ["vehrepair", "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
    
        sleep 5;
        PAPABEAR sideChat "Crash site chopper is online again. Good job soldiers!";
        deleteMarker _marker2;
        sleep 10;

        PAPABEAR sideChat "JOKER is going RTB, anyone need a lift? Get in fellows!";
    
        sleep 15;
        {
        _x enableAI "MOVE";
        _x moveInAny _joker;
        } forEach units _jokerGrp;
 
        _wp =_jokerGrp addWaypoint [getMarkerPos "respawn_west", 0];
        _wp setWaypointType "MOVE";
        waitUntil {(getPos _joker select 2) > 3 AND (speed _joker) > 5};
        _landpos = [getMarkerPos "respawn_west", 100, 100, 15, 0, 0, 0] call BIS_fnc_findSafePos;
        landpad = createVehicle ["Land_HelipadEmpty_F", _landpos, [], 0, "NONE"];
        _joker land "landpad";
        waitUntil {(getPos _joker select 2) < 1 AND (speed _joker) < 1};
        deleteVehicle landpad;
        PAPABEAR sideChat "Joker is RTB and ready for tasking.";

Thats all.

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
Sign in to follow this  

×